FatalThrowableError:参数 1 已通过 ..::fromUser() laravel 5.6
问题描述
我使用邮递员添加用户或登录,用户添加成功但我收到此错误
I use postman to add user or to login , user has added with sucess but I get this error
"传递给 TymonJWTAuthJWT::fromUser() 的参数 1 必须是TymonJWTAuthContractsJWTSubject 的实例,AppUser 的实例给定,在 C:UsersWeb 中调用WorkStationDesktoplaravelappjwtlaravelvendor ymonjwt-authsrcJWTAuth.php第 54 行"
"Argument 1 passed to TymonJWTAuthJWT::fromUser() must be an instance of TymonJWTAuthContractsJWTSubject, instance of AppUser given, called in C:UsersWeb WorkStationDesktoplaravelappjwtlaravelvendor ymonjwt-authsrcJWTAuth.php on line 54"
我在这个 ligne 中找到了这个函数
and I found in this ligne this founction
这是我的用户模型:
推荐答案
在你的 User 模型中实现 JWTSubject
:
Implement the JWTSubject
in your User model:
这篇关于FatalThrowableError:参数 1 已通过 ..::fromUser() laravel 5.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!