songService->updateSongs($request->songs, SongUpdateData::fromRequest($request)); $albums = $this->albumRepository->getByIds($updatedSongs->pluck('album_id')->toArray(), $this->user); $artists = $this->artistRepository->getByIds( array_merge( $updatedSongs->pluck('artist_id')->all(), $updatedSongs->pluck('album_artist_id')->all() ) ); return response()->json([ 'songs' => SongResource::collection($updatedSongs), 'albums' => AlbumResource::collection($albums), 'artists' => ArtistResource::collection($artists), 'removed' => $this->libraryManager->prune(), ]); } }