egerde sargyt döredeniň roly bar ulanyjy bolsa, oňa notification barmaly däl

This commit is contained in:
2025-05-09 22:44:17 +05:00
parent 7466166167
commit 8aca14f17e
2 changed files with 24 additions and 3 deletions

View File

@@ -222,4 +222,18 @@ class User extends Authenticatable
{
return $this->options && array_key_exists($option, $this->options) ? $this->options[$option] : '';
}
/**
* Check if user has roles
*/
public function doesntHaveRoles(): bool
{
if ($this->isMe()) {
return false;
}
$this->loadMissing('roles');
return $this->roles->count() < 1;
}
}