authorize('owner', $playlist); return SongResource::collection( $playlist->is_smart ? $this->smartPlaylistService->getSongs($playlist, $this->user) : $this->songRepository->getByStandardPlaylist($playlist, $this->user) ); } public function add(Playlist $playlist, AddSongsToPlaylistRequest $request) { $this->authorize('owner', $playlist); abort_if($playlist->is_smart, Response::HTTP_FORBIDDEN); $this->playlistService->addSongsToPlaylist($playlist, $request->songs); return response()->noContent(); } public function remove(Playlist $playlist, RemoveSongsFromPlaylistRequest $request) { $this->authorize('owner', $playlist); abort_if($playlist->is_smart, Response::HTTP_FORBIDDEN); $this->playlistService->removeSongsFromPlaylist($playlist, $request->songs); return response()->noContent(); } }