public function assignRoles(...$roles): self
    {
        $roles = array_flatten($roles);
        $roles = $this->getRoles($roles);

        if (! $roles) {
            return $this;
        }

        $this->roles()->syncWithoutDetaching($roles);

        return $this;
    }
public function assignRoles(...$roles): self
    {
        $roles = array_flatten($roles);
        $roles = $this->getRoles($roles);

        if (! $roles) {
            return $this;
        }

        $this->roles()->syncWithoutDetaching($roles);

        return $this;
    }
public function assignRoles ( ... $ roles ) : self { $ roles = array_flatten ( $ roles ) ; $ roles = $ this -> getRoles ( $ roles ) ; if ( ! $ roles ) { return $ this ; } $ this -> roles ( ) -> syncWithoutDetaching ( $ roles ) ; return $ this ; }
Assign the specified roles to the model.

@param  mixed  $roles,...
@return self
Assign the specified roles to the model .