mediaMetadataService = $mediaMetadataService; } /** * Upload an album's cover * * Upload an image as an album's cover. * * @bodyParam cover string required The cover image's content, in Data URI format. * Example: data:image/jpeg;base64,Rm9v * @responseFile responses/albumCover.update.json * * @return JsonResponse */ public function update(AlbumCoverUpdateRequest $request, Album $album) { $this->mediaMetadataService->writeAlbumCover( $album, $request->getFileContentAsBinaryString(), $request->getFileExtension() ); event(new LibraryChanged()); return new JsonResponse(['coverUrl' => $album->cover]); } }