Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sanjayacloud's avatar

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.

0 likes
2 replies
ftiersch's avatar
$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.

Please or to participate in this conversation.