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;
}