Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flysystem file not found when deleting

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?

like image 348
Alan Avatar asked Jul 10 '15 17:07

Alan


1 Answers

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(),
    ],
]
like image 199
Alan Avatar answered Sep 20 '22 15:09

Alan