App\Http\Controllers\API\PlaylistController::sync PHP Method

sync() public method

Any songs that are not populated here will be removed from the playlist.
public sync ( Illuminate\Http\Request $request, Playlist $playlist ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$playlist app\models\Playlist
return Illuminate\Http\JsonResponse
    public function sync(Request $request, Playlist $playlist)
    {
        $this->authorize('owner', $playlist);
        $playlist->songs()->sync((array) $request->songs);
        return response()->json();
    }