PHPackages                             chantouch/laravel-jwt-redis - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. chantouch/laravel-jwt-redis

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

chantouch/laravel-jwt-redis
===========================

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

v3.2.1(2y ago)95.4k↓35.7%1MITPHPPHP &gt;=8.1CI failing

Since May 23Pushed 2y ago2 watchersCompare

[ Source](https://github.com/chantouchsek/laravel-jwtredis)[ Packagist](https://packagist.org/packages/chantouch/laravel-jwt-redis)[ RSS](/packages/chantouch-laravel-jwt-redis/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (13)Used By (0)

laravel-jwt-redis
=================

[](#laravel-jwt-redis)

[![](https://camo.githubusercontent.com/7ba46b14279538af1c6f0cdb40d479f8015807381063faa5f9fc3be6f9d5ab78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368616e746f7563682f6c61726176656c2d6a77742d7265646973)](https://packagist.org/packages/chantouch/laravel-jwt-redis)[![](https://camo.githubusercontent.com/c0f94c324cb26bdeae4d6f76d98bbba9a53c513c4f870718e07e2821339b5ef6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3233343330343530352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/234304505)[![](https://camo.githubusercontent.com/b41bab85cd857e86090afc6c6423b0c54c76ff14084772a42d5139d1c125597b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6368616e746f7563682f6c61726176656c2d6a77742d7265646973)](https://raw.githubusercontent.com/chantouch/laravel-jwt-redis/master/LICENSE)[![](https://camo.githubusercontent.com/f071317b945f524938eedd2eb00b0cdf764c9cc429cf181c1217a2ef3f330993/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368616e746f7563682f6c61726176656c2d6a77742d72656469733f636f6c6f723d73756363657373)](https://packagist.org/packages/chantouch/laravel-jwt-redis)

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

> This package is originally forked from [sametsahindogan/laravel-jwtredis](https://github.com/sametsahindogan/laravel-jwtredis)

[![](https://camo.githubusercontent.com/81db71691478bb110f72fc93efe262652fded4eff25455ba761c1c1fd169d45a/68747470733a2f2f63646e2e61757468302e636f6d2f626c6f672f6a7774616c676f732f6c6f676f2e706e67)](https://camo.githubusercontent.com/81db71691478bb110f72fc93efe262652fded4eff25455ba761c1c1fd169d45a/68747470733a2f2f63646e2e61757468302e636f6d2f626c6f672f6a7774616c676f732f6c6f676f2e706e67)[![](https://camo.githubusercontent.com/4d28958330457f539357f95c739cf5763e327c0720ac3dad71f255e65fbbd41b/68747470733a2f2f63646e342e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f72656469732d322f313435312f556e7469746c65642d322d3531322e706e67)](https://camo.githubusercontent.com/4d28958330457f539357f95c739cf5763e327c0720ac3dad71f255e65fbbd41b/68747470733a2f2f63646e342e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f72656469732d322f313435312f556e7469746c65642d322d3531322e706e67)

> Also, this package has 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
------------

[](#requirements)

This package works with together [php-open-source-saver/jwt-auth](https://github.com/PHP-Open-Source-Saver/jwt-auth) and [spatie/laravel-permission](https://github.com/spatie/laravel-permission) package under the hood.

[![#](https://camo.githubusercontent.com/0f961518a7ec2afddbe358d250696841250391fd10d08f87047ec0e63321be23/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b)](https://camo.githubusercontent.com/0f961518a7ec2afddbe358d250696841250391fd10d08f87047ec0e63321be23/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b) `Make sure to install and configure these dependencies. You must publish, migrate etc. all packages.` [![#](https://camo.githubusercontent.com/0f961518a7ec2afddbe358d250696841250391fd10d08f87047ec0e63321be23/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b)](https://camo.githubusercontent.com/0f961518a7ec2afddbe358d250696841250391fd10d08f87047ec0e63321be23/68747470733a2f2f706c616365686f6c642e69742f31352f6630336331352f3030303030303f746578743d2b)

- [predis/predis](https://github.com/predis/predis) **&gt;= 2.0** (**Recommended 2.2**)
- [php-open-source-saver/jwt-auth](https://github.com/PHP-Open-Source-Saver/jwt-auth) **&gt;= 2.0** (**Recommended 2.2.x**)
- [spatie/laravel-permission](https://github.com/spatie/laravel-permission) **&gt;= 6.0** (**Recommended 6.4**) (Optional)

Installation
------------

[](#installation)

```
composer require chantouch/laravel-jwt-redis
```

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

```
CACHE_DRIVER=redis
REDIS_CLIENT=predis
```

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

```
