Sep 14, 2017
0
Level 14
Intervention Image source not readable
Well, i am using intervention with laravel 5.5 to upload photos. When i create a new recipe(in my case), all is working and the photos are being uploaded succefully.
This is the code for the initial upload:
$front_image = $request->file('front_image');
$frontImageName = md5(time()) . '.' . $front_image
->getClientOriginalExtension();
$locationfi = public_path('photos/front/' . $frontImageName);
Image::make($front_image)
->resize(454,340)
->insert(public_path('photos/logo.png'),'bottom-right')
->save($locationfi);
$recipe->front = $frontImageName;
All standard stuff. But when i try to edit a recipe, i get Image source not readable. This is the code for the re upload:
$front_image = $request->file('front_image');
$frontImageName = md5(time()).'.'.$front_image
->getClientOriginalExtension();
$location = public_path('photos/front/'.$frontImageName );
Image::make($front_image)->resize(690,517)
->insert(public_path('photos/tk.png'),'bottom-right')
->save($location);
$recipe->front=$imageName;
I use enctype="multipart/form-data" in both forms, for create and update. On the edit form i also use {{method_field('PUT'}}.
What am i missing here? Thanks.
Please or to participate in this conversation.