uploadService = $uploadService; } public function store(UploadRequest $request): JsonResponse { try { $song = $this->uploadService->handleUploadedFile($request->file); } catch (MediaPathNotSetException $e) { abort(Response::HTTP_FORBIDDEN, $e->getMessage()); } catch (SongUploadFailedException $e) { abort(Response::HTTP_BAD_REQUEST, $e->getMessage()); } event(new MediaCacheObsolete()); return response()->json($song->load('album', 'artist')); } }