/** * Assign a role to the entity. * * @param string $role Role name * * @return mixed */ public function assignRole($role) { return $this->roles()->save(Role::where($role)->firstOrFail()); }