How can I move an image from one folder to another folder?

Viewed 3030

I use Laravel 5.3

When I upload image, I save the image in :

C:\xampp\htdocs\myshop\storage\temp

My code to save the image like this :

private function addPhoto(UploadedFile $photo, $fileName)
{
    $destinationPath = storage_path() . DIRECTORY_SEPARATOR . 'temp';
    $photo->move($destinationPath, $fileName);
    return $fileName;
}

When I click button submit, I want to move the image from folder storage to folder public

So I want to move the image in :

C:\xampp\htdocs\myshop\public\img

How can I move the image in folder public?

1 Answers
Related