I was trying to use spatie role and permission but when i try to update role and permission it gives me the above error and highlights the if statement in the function below located inside the user model
public static function roleHasPermissions($role,$permissions){
Код: Выделить всё
$hasPermission=true;
// dd($role);
// dd($perm);
foreach($permissions as $permission){
if(!$role->hasPermissionTo($permission)){
$hasPermission=true;
}
}
return $hasPermission;
}
Источник: https://stackoverflow.com/questions/781 ... esnotexist
Мобильная версия