安装jwt-auth

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Bepthslowly/article/details/88038056

1、修改composer.json文件,在 require中添加

"tymon/jwt-auth": "^1.0.0-rc.1"

2、然后使用命令行,进入项目目录,执行

composer update
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"

3、转跳官网继续

4、将Auth::guard()修改为Auth::guard("api");

5、生成密钥

php artisan jwt:secret

6、访问http://localhost:8000/api/auth/login

猜你喜欢

转载自blog.csdn.net/Bepthslowly/article/details/88038056