![cbd1f4da0db0f91d555b9c060866e800.png](https://i-blog.csdnimg.cn/blog_migrate/8ccb786926b435474cb6f5f1784753fe.jpeg)
1:首先通过composer进行安装
composerrequiretymon/jwt-auth
![c659cb81d996b0c438417c776f84531d.png](https://i-blog.csdnimg.cn/blog_migrate/4e492e785772af1128f1f64a8e20eb5b.jpeg)
2:添加服务提供者
编辑config/app.php,在"providers"添加:
'TymonJWTAuthProvidersJWTAuthServiceProvider',
![8a26da3ac3504820720e6f9da00db13a.png](https://i-blog.csdnimg.cn/blog_migrate/7eddfdd14a6a9f12f6559758c498851a.jpeg)
3:添加Facades
编辑config/app.php,在"alias"添加:
'JWTAuth'=>'TymonJWTAuthFacadesJWTAuth',
'JWTFactory'=>'TymonJWTAuthFacadesJWTFactory',
![80bbca50304fb010a787e076155e4539.png](https://i-blog.csdnimg.cn/blog_migrate/161ffb7a58e4d66d7496ac0c7520cdf5.jpeg)
4:发布配置文件:
phpartisanvendor:publish--provider="TymonJWTAuthProvidersJWTAuthServiceProvider"
![440cb07856d83754a652f5cb5998fd69.png](https://i-blog.csdnimg.cn/blog_migrate/1845464a84f9ddd902f76c2ad0faab61.jpeg)
5:生成secretkey
:phpartisanjwt:generate
安装完成后,执行phpartisanjwt:generate,会报错:
(1).MethodTymonJWTAuthCommandsJWTGenerateCommand::handle(