Comment obtenir le rôle de l'utilisateur dans Laravel Spatie
$user->getRoleNames()
Mohamad
$user->getRoleNames()
$users = User::role('writer')->get();
$user->assignRole('writer');
// You can also assign multiple roles at once
$user->assignRole('writer', 'admin');
// or as an array
$user->assignRole(['writer', 'admin']);
$role->syncPermissions($permissions);
$permission->syncRoles($roles);