Argument 2 passed to Tymon\JWTAuth\JWTGuard::__construct() must implement interface Illuminate\Contracts\Auth\UserProvider,
时间: 2023-08-16 10:16:37 浏览: 148
failed call to cuInit: CUDA_ERROR_NO_DEVICE解决方法
3星 · 编辑精心推荐
回答: 根据引用\[1\]和引用\[2\]的信息,问题是Argument 2 passed to Tymon\JWTAuth\JWTGuard::__construct() must implement interface Illuminate\Contracts\Auth\UserProvider。这个错误是因为在Tymon\JWTAuth\JWTGuard的构造函数中,第二个参数需要实现Illuminate\Contracts\Auth\UserProvider接口。根据引用\[3\]的信息,可以通过实现Illuminate\Contracts\Auth\UserProvider接口或继承Illuminate\Auth\EloquentUserProvider来解决这个问题。
#### 引用[.reference_title]
- *1* [jwt-auth错误小结](https://blog.csdn.net/weixin_34199405/article/details/93397492)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [使用jwt-auth的报错解决 Argument 1 passed to Tymon\\JWTAuth\\JWT::fromUser()](https://blog.csdn.net/wuchengzeng/article/details/88797030)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Tymon\\JWTAuth\\JWT Undefined index: password](https://blog.csdn.net/Anglry/article/details/124116393)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文