Reputation: 1827
I have the following code:
public function store(string $folder, $file){
$ret = Storage::putFileAs("/application/public/storage/1/{$folder}", $file, $file->getClientOriginalName());
return $ret;
}
}
Where the path to the putFileAs
function ends up being /application/public/storage/1/tasks/NXL-1
after feeding the variable $folder
, but even tho the variable $ret
in the return has the path to that file as if it worked /application/public/storage/1/tasks/NXL-1/image.png
, when I go to that folder the file is not there. What should I do?
Upvotes: 1
Views: 1634
Reputation: 48
you can use storeAs method in laravel 8.
for example
$imageFileName = $request->image_name->getClientOriginalname();
$request->image_name->storeAs('images/portfolio', $imageFileName, 'publicfolder');
Upvotes: 2