老师,我在用hasRole()方法的时候
$user = User::find(4);
if($user->HasRole(5)){
return 1;
}
return 2;
}
提示我Trying to get property of non-object in file D:\WampDemo\XC\vendor\bican\roles\src\Bican\Roles\Traits\HasRoleAndPermission.php on line 104 。我的$user是存在的,也是object类型的啊,为什么会出错