Upgrade to 3.4.3
This commit is contained in:
@@ -39,11 +39,18 @@ class Role extends Model
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $inject
|
||||
* @return self
|
||||
*/
|
||||
public static function admin(array $inject = [])
|
||||
{
|
||||
try {
|
||||
@@ -53,6 +60,9 @@ class Role extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected static function defaults(): array
|
||||
{
|
||||
return [
|
||||
@@ -71,6 +81,9 @@ class Role extends Model
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function description()
|
||||
{
|
||||
return $this->description;
|
||||
@@ -86,16 +99,25 @@ class Role extends Model
|
||||
return new static($props + $inject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function id(): string
|
||||
{
|
||||
return $this->name();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->name() === 'admin';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isNobody(): bool
|
||||
{
|
||||
return $this->name() === 'nobody';
|
||||
@@ -114,6 +136,9 @@ class Role extends Model
|
||||
return static::factory($data, $inject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function name(): string
|
||||
{
|
||||
return $this->name;
|
||||
@@ -180,6 +205,9 @@ class Role extends Model
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return $this->title = $this->title ?? ucfirst($this->name());
|
||||
|
Reference in New Issue
Block a user