public function addRole($idOrName)
    {
        $ids = is_array($idOrName) ? $idOrName : func_get_args();

        foreach ($ids as $search) {
            $role = Role::search($idOrName)->firstOrFail();

            $this->roles()->attach($role->id);
        }
    }
public function addRole($idOrName)
    {
        $ids = is_array($idOrName) ? $idOrName : func_get_args();

        foreach ($ids as $search) {
            $role = Role::search($idOrName)->firstOrFail();

            $this->roles()->attach($role->id);
        }
    }
public function addRole ( $ idOrName ) { $ ids = is_array ( $ idOrName ) ? $ idOrName : func_get_args ( ) ; foreach ( $ ids as $ search ) { $ role = Role :: search ( $ idOrName ) -> firstOrFail ( ) ; $ this -> roles ( ) -> attach ( $ role -> id ) ; } }
Add role to user.

@param $idOrName
Add role to user .