user->playlists); } public function store(PlaylistStoreRequest $request) { $playlist = $this->playlistService->createPlaylist( $request->name, $this->user, Arr::wrap($request->songs), $request->rules ); return PlaylistResource::make($playlist); } public function update(PlaylistUpdateRequest $request, Playlist $playlist) { $this->authorize('own', $playlist); return PlaylistResource::make( $this->playlistService->updatePlaylist( $playlist, $request->name, Arr::wrap($request->rules) ) ); } public function destroy(Playlist $playlist) { $this->authorize('own', $playlist); $playlist->delete(); return response()->noContent(); } }