How to delete files using laravel
I am using DigitalOcean Spaces as a configured disk in Laravel and was having a problem with deletion of file using the following codes:
I have no problem uploading photos but I wanna have an option of replacing a file when a new one is uploaded. I tried this using my local disk and it worked, but when using do_spaces disk, nothing happens. I can even check that the file exists by using
Storage::disk('spaces')->exists('foldername/'.$fileName); before trying to delete.
I am not sure if this is an issue in do spaces or is delete function like above is not supported here. Any idea what I’m doing wrong? Thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×