jeudi 20 octobre 2022

Cannot move image/files temp to public directory Laravel 9

I am trying to upload image in Laravel. Getting following error:

enter image description here

My code is given below:

public function uploadImage($image, $image_path)
{
    $path = config('global.' . $image_path . '_image_path');

    file_exists($image) && unlink($image);

    $image_name = 'bvend-' . $image_path . '-' . time() . '.' . $image->getClientOriginalExtension();

    $image->move($path, $image_name); // $path: public_path('uploads/products')
    return $image_name;
}

I understand its a simple issue but still no clue where it causing issue.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire