gpt4 book ai didi

laravel-5 - 错误!尚未应用特征方法恢复,因为与 App\User-laravel softdelete 上的其他特征方法存在冲突

转载 作者:行者123 更新时间:2023-12-02 03:59:09 25 4
gpt4 key购买 nike

使用 softdelete 后出现此错误,如何使用其他特征修复 softdelete..

class User extends Authenticatable
{
use HasApiTokens, Notifiable;
use EntrustUserTrait {
can as traitCan;
hasRole as traitHasRole;
}
use SoftDeletes;
protected $table = 'users';

最佳答案

终于我找到了答案:

我决定改用软删除恢复。

use HasApiTokens, Notifiable;
use EntrustUserTrait {
can as traitCan;
hasRole as traitHasRole;
}
use SoftDeletes { SoftDeletes::restore insteadof EntrustUserTrait; }

或者如果您想同时使用两者:

use SoftDeletes,EntrustUserTrait{
SoftDeletes::restore as soft_delete_restore;
EntrustUserTrait::restore as entrust_restore;
}

关于laravel-5 - 错误!尚未应用特征方法恢复,因为与 App\User-laravel softdelete 上的其他特征方法存在冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42647211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com