Download the PHP package sametsahindogan/laravel-jwtredis without Composer

On this page you can find all versions of the php package sametsahindogan/laravel-jwtredis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-jwtredis

laravel-jwtredis

This package allows JWT-authenticated users to be stored and management in Redis with their roles, permissions, statuses and anything you want.

Also this package have an observer for listening and updating to your user model on Redis. This observer is triggered when you assign roles & permissions to user, or update and delete to your user model.

Requirements

This package work with together tymondesigns/jwt-auth and spatie/laravel-permission package under the hood.

!Make sure to install and configure these dependencies. You must publish, migrate etc. all packages.!

Installation

Once this has finished, you will need to add&change these values in .env file:

Next, you will need to change the guards and providers arrays in your config/auth.php config as follows:

This package uses auto-discovery to register the service provider but if you'd rather do it manually, the service provider is: add to providers array in your config/app.php config as follows:

You will want to publish the config using the following command:

Configurations

When everything is done, don't forget to add this Trait to your user model.

You need to add $routeMiddleware array in app/Http/Kernel.php

Usage

You do not have any instructions for use. This package only affects the background, functions in an almost identical way to Laravel session authentication, with a few exceptions. All you have to do is change your middleware.(I mention this below) You can use Laravel's Auth facade, Tymon's JWTAuth facade and all spatie/laravel-permission package methods as usual.


If you want to do different things, you can override those mentioned middlewares.

After using it as above, every authorization you made in your application, such as Auth::user() or $user->can('permission'), is always checked from Redis, not from the database.

Options

You can customize some options in that package. Check config/jwtredis.php file.

Example Project

Here is an example using laravel-jwtredis. You can examine in detail.

Performance Improvements Tips

You may install the PhpRedis PHP extension via PECL. The extension is more complex to install but may yield better performance for applications that make heavy use of Redis. Predis is the alternative for PhpRedis on pure PHP and does not require any additional C extension by default.

"PhpRedis is faster about x6 times. Using igbinary serializer reduces stored data size about 3x times. If Redis installed on separate machines, reducing network traffic is a very significant speedup."

In my opinion, using PhpRedis and serializer as igbinary ( Laravel does not support igbinary serialization on Redis. However, this package provides igbinary serialization support for Laravel. Please check config/jwtredis.php file. ) in production environment gives a great performance.

You can review this article for performance comparison PhpRedis vs. Predis.

Integrate with Laravel Swoole Package

This package fully compatible with Laravel Swoole package. If you want to use it together, all you have to do is change the instances and providers arrays in your config/swoole_http.php config as follows:

License

MIT © Samet Sahindogan


All versions of laravel-jwtredis with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
tymon/jwt-auth Version ^1.0.2
spatie/laravel-permission Version ^4.0
sametsahindogan/response-object-creator Version 1.0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sametsahindogan/laravel-jwtredis contains the following files

Loading the files please wait ....