private function retrieveTestImage() { $imageRepository = new ImageRepository(); return $imageRepository->getById(1); }
/** * Upload and save image information * * @param UploadImageRequest $request * @return \Illuminate\Http\JsonResponse * @throws \Exception * @throws \Throwable */ public function upload(UploadImageRequest $request) { $upload = $this->uploader->upload($request->file('image'), storage_path('app/laramanager/images')); $image = $this->imageRepository->create($upload->toArray()); return $this->jsonResponse(array_merge(['html' => view('laramanager::' . $request->get('view'), compact('image'))->render()], $image->toArray())); }