You will have to provider proper driver/disk info. By default (as in config/filesystems.php) default disk is local which points to
'root' => storage_path('app'),
All paths will be resolved relative to above.
Hi guys,
I have a method that handles image uploads. This method needs to delete the old image, before the new one is uploaded so I dont have to do a lot of manual cleanup.
Im using Laravels file_exists with success a bit further down, in my method, however in this particular case I want to basically just return a string from my javascript, that it should check against to get the old image path.
However it does not delete the old image, from the images folder, what am I doing wrong here?
public function uploadImage(Request $request)
{
$oldImage = $request->get('old_image_path');
if (file_exists(public_path($oldImage))) {
Storage::delete(public_path($oldImage));
}
...
}
When I dd $oldImage i get this:
"/images/marker.svg"
Please or to participate in this conversation.