Silber\Bouncer\Database\Models::role PHP Method

role() public static method

Get an instance of the role model.
public static role ( array $attributes = [] ) : Role
$attributes array
return Role
    public static function role(array $attributes = [])
    {
        return static::make(Role::class, $attributes);
    }

Usage Example

Example #1
0
 /**
  * Get or create the role.
  *
  * @return \Silber\Bouncer\Database\Role
  */
 protected function role()
 {
     if ($this->role instanceof Role) {
         return $this->role;
     }
     return Models::role()->firstOrCreate(['name' => $this->role]);
 }
All Usage Examples Of Silber\Bouncer\Database\Models::role