Caffeinated\Shinobi\Traits\ShinobiTrait::assignRole PHP Метод

assignRole() публичный Метод

Assigns the given role to the user.
public assignRole ( integer $roleId = null ) : boolean
$roleId integer
Результат boolean
    public function assignRole($roleId = null)
    {
        $roles = $this->roles;
        if (!$roles->contains($roleId)) {
            return $this->roles()->attach($roleId);
        }
        return false;
    }