I can check the $path correctness by using command line to test the past. But Storage::delete() does do work.
Could someone please help? And what should I do when a file's name is with spaces? How to return Storage errors so I know what's is happening?
@hadihasanpur I can just call this endpoint again and again with different paths, until i have everything deleted. I could start with path = 'index.php' to bring down your site :)
I tried both options but it did not works. test with command line from public folder ok.
@Snapey: I will need do more for authorization. Should not pass the pass via request but I have no idea why the delete() is not working at all. I wish It can give some errors.
The order in which you delete does not matter here since you declare you variables before you delete the record from the DB and you do not actually take them from database at all but from a request.
Hardcode it. See it it works and work backwards and you will find where the problem is. Storage should return true on success.
I have the same issue. I tried it in "php artisan tinker" with the exact same path and it works. But not via browser. I think this is permission issue.
Is there anyway to do it in laravel's way? Because I don't want to use unlink($filename).