简体   繁体   English

Laravel无法使用已被软删除的用户的令牌

[英]Laravel Cannot use Token of user that has been Soft-Delete

由软删除的用户生成的令牌不起作用,有什么方法可以使用软删除的用户的令牌?

If you want to get the user that has been softDeleted. 如果要获取已被softDeleted的用户。 You must use the withTrashed method. 您必须使用withTrashed方法。 So if you want to find the softDeleted user with a token you must write something like this code below: 因此,如果要使用令牌查找softDeleted用户,则必须在下面编写类似以下代码的内容:

$user = User::whereToken($token)->withTrashed()->first();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM