app/Http/Traits/HasRoles.php
/**
     * Remove all current roles and set the given ones.
     *
     * @param array $roles
     * @return $this
     */
Remove all current roles and set the given ones.
@param array $roles
@return $this
Remove all current roles and set the given ones . @param array $roles @return $this
public function syncRoles(...$roles) {
        $this->roles()->detach();
        return $this->assignRole($roles);
    }
public function syncRoles ( ... $ roles ) { $ this -> roles ( ) -> detach ( ) ; return $ this -> assignRole ( $ roles ) ; }
Remove all current roles and set the given ones.
Remove all current roles and set the given ones .