Image Source not readable in laravel 5.7
I am trying to upload image but i get error above in subject.
this my code
$featuredImageArray = array();
$f = 1;
foreach($request['featured_image'] as $featuredImage){
$featuredImageArray[$f] = $featuredImage;
$image_path = Image::make($featuredImageArray);
$set_img_path = time().$featuredImageArray->getClientOriginalName();
$image_path->save(public_path().'/uploads/experience/'.$set_img_path);
$f++;
}
dd($set_img_path);
Can anyone help me to resolve this error.
$image_path = Image::make($featuredImageArray);
This doesn't make sense. You're trying to create an Image from the array. You need to create it from the filepath.
Same here:
$featuredImageArray->getClientOriginalName();
You need to get the file object from the request. Like
$request->file('featured_image')
Then you can call getRealPath() and create an image from that and save it later to your folder.
@FTIERSCH - I didn't understand, Can you explain more?
Please or to participate in this conversation.