Laravel JWT Redis | laravel jwt redis
LaravelJWTRedisallowsJWT-authenticateduserstobestoredandmanagedinRediswiththeirroles,permissions,statuses,andotherdata.Itworkstogetherwithtymondesigns/jwt-auth[1]andspatie/laravel-permission[2]packageunderthehood.AtthecoreofthepackageisthemodelJWTRedisHasRolesandworksinthebackground—itfunctionsalmostidenticallytoLaravelsessionauthentication.Checkoutthereadmefornuancesinhowthispackagehandlesauth.Youconfigureauthwiththefollowingguardandproviderprovidedbythepackage:guards=>[api=>[driver=&...
Laravel JWT Redis allows JWT-authenticated users to be stored and managed in Redis with their roles, permissions, statuses, and other data. It works together with tymondesigns/jwt-auth[1] and spatie/laravel-permission[2] package under the hood.
At the core of the package is the model JWTRedisHasRoles and works in the background—it functions almost identically to Laravel session authentication. Check out the readme for nuances in how this package handles auth.
You configure auth with the following guard and provider provided by the package:
guards => [
api => [
driver => jwt_redis_guard,
provider => users
],
],
providers => [
users => [
driver => jwt_redis_user_provider,
model => AppUser::class, /* Your User Model */
],
],
Here’s a few examples of route usage:
Route::get("/example", "ExampleController@e...