I do not know why I am not able to delete a file in Laravel with the code:
$path = storage_path('app/identification_cards') . '/' . $filename;
Storage::delete($path)
The command is executed without errors and it returns true.
What I checked:
- the path is correct. If I use the same exact path in a bash terminal (with the "rm" command) the file is deleted;
- the file does have 777 permissions.
I don't know how to solve it.
Thanks.
Storage::delete
will point to storage\app\
path so no need to add app folder name once again
Storage::delete('identification_cards/'.$filename);