lyue/laravel-jwt
Composer 安装命令:
composer require lyue/laravel-jwt
包简介
laravel jwt
README 文档
README
JWT plugin for laravel
is maybe the simplest JWT plugin
Installation
composer require lyue/laravel-jwt
config
php artisan vendor:publish
and choose the lyue/laravel-jwt,it will create a config file jwt.php in config path
//provider
Lyue\LaravelJwt\JwtProvider::class
//facade
'Jwt' => \Lyue\LaravelJwt\JwtFacade::class
set it into provider and facade of config/app.php
Example
get a token
$payload = [
'user_id'=>123,
'iss'=>'www.baidu.com'
];
$token = \Jwt::getToken($payload);
check token
\Jwt::verifyToken($token);
get payload
$payload = \Jwt::getPayload();
get payload by key
$user_id = \Jwt::getPayload('user_id');
you can set key=>value as session
\Jwt::set('username',$username);
var_dump(\Jwt::get('username'));
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-23