I'm trying to delete a photo with Laravel 5.
Storage::delete( asset('/uploads/slides/abcd.jpg'));
Its returning this error:
FileNotFoundException in Filesystem.php line 428:
File not found at path: http:/localhost:8000/uploads/slides/abcd.jpg
If I copy and paste the path in the browser it opens the file so the file really exists. Whats wrong?
I found the solution.
I had to change the root path in config/filesystem.php because it was looking the file in the old defined path (the storage path)
This is the modified version
'disks' => [
'local' => [
'driver' => 'local',
'root' => public_path(),
],
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With