egerde sargyt döredeniň roly bar ulanyjy bolsa, oňa notification barmaly däl
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user