Good
I have a form that uploads images, these images are played in the directory: uploads/{idcampaign}/images/
In my PHP controller how do I access this image and get its contents?
public function get($id) {
/** @var UploadedFile $file */
$image = $this->repository->byId($id)->first();
$url = "/storage/app/" + $image->path;
if($image) {
return response()->file($url , ['Content-Type' => 'image.png |
image.jpeg']);
}
throw new NotFoundHttpException('image-not-found');
}
I tried this and it did not. I just need to get into the image and grab its contents to be able to return to the view.