quangdung93/jwt-redis
Composer 安装命令:
composer require quangdung93/jwt-redis
包简介
This package to add JSON Web Token to Redis
README 文档
README
composer require quangdung93/jwt-redis
Publish config
php artisan vendor:publish --provider="Ajax\JwtRedis\JwtRedisServiceProvider"
Config
config/jwt_redis.php
//Limit the number of tokens stored in redis 'limit_token' => 5, //The keys in the payload are used to hash session_id 'key_payload_hash' => [ 'imei', 'user_id' ], // Except route affected by middleware 'route_except' => [ 'api/login' ]
Use
// use Ajax\JwtRedis\Facades\JwtRedis; $imei = '123'; $user_id = '1'; $params = [$imei, $user_id]; //$params is array include key payload used to hash to session_id // Save token to redis JwtRedis::set($token, $params) //Get token JwtRedis::get($params) //Check token exists in Redis JwtRedis::check($token, $params)
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-08