PHPackages                             daglab/laravel-redis-jwt - 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. daglab/laravel-redis-jwt

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

daglab/laravel-redis-jwt
========================

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

05PHP

Since Feb 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/daglab/laravel-redis-jwt)[ Packagist](https://packagist.org/packages/daglab/laravel-redis-jwt)[ RSS](/packages/daglab-laravel-redis-jwt/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#laravel-redis-jwt)

[![](https://camo.githubusercontent.com/69c5443b29f44d72d043cc14d55c0f192d3f7be90cf64fadb0e5a33b387abf0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461676c61622f6c61726176656c2d72656469732d6a7774)](https://packagist.org/packages/daglab/laravel-redis-jwt)[![](https://camo.githubusercontent.com/c0f94c324cb26bdeae4d6f76d98bbba9a53c513c4f870718e07e2821339b5ef6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3233343330343530352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/234304505)[![](https://camo.githubusercontent.com/0e1e61c9fb46ea9dc13a1ac32aa4e15630574359b4946991444cb2ccab47067a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6461676c61622f6c61726176656c2d72656469732d6a7774)](https://raw.githubusercontent.com/daglab/laravel-redis-jwt/master/LICENSE)[![](https://camo.githubusercontent.com/a3b937ad63354c7231fda520980530bf205f2673523c060f982e93afd5f6813b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461676c61622f6c61726176656c2d72656469732d6a77743f636f6c6f723d73756363657373)](https://packagist.org/packages/daglab/laravel-redis-jwt)

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

[![](https://camo.githubusercontent.com/81db71691478bb110f72fc93efe262652fded4eff25455ba761c1c1fd169d45a/68747470733a2f2f63646e2e61757468302e636f6d2f626c6f672f6a7774616c676f732f6c6f676f2e706e67)](https://camo.githubusercontent.com/81db71691478bb110f72fc93efe262652fded4eff25455ba761c1c1fd169d45a/68747470733a2f2f63646e2e61757468302e636f6d2f626c6f672f6a7774616c676f732f6c6f676f2e706e67)[![](https://camo.githubusercontent.com/9fb65a2e817861a2af8e318adf15634dfac5a5f937afaf04c14c0dbb1ae550c2/68747470733a2f2f63687269732e6c752f75706c6f61642f696d616765732f72656469732e706e67)](https://camo.githubusercontent.com/9fb65a2e817861a2af8e318adf15634dfac5a5f937afaf04c14c0dbb1ae550c2/68747470733a2f2f63687269732e6c752f75706c6f61642f696d616765732f72656469732e706e67)

> 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 work 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)

- [nrk/predis](https://github.com/nrk/predis) **&gt;= 1.1**
- [php-open-source-saver/jwt-auth:](https://github.com/php-open-source-saver/jwt-auth:) **&gt;= 1.4**
- [spatie/laravel-permission](https://github.com/spatie/laravel-permission) **&gt;= 5.5** (Optional)

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

[](#installation)

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

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:

```
