Laravel Storage::disk('public')->delete() not deleting

I’ve managed to deploy my Laravel application on, but I’ve run into a problem.

While I can upload image files to the storage using Storage::disk('public')->put(), I’m unable to delete any of them using Storage::disk('public')->delete().

Could someone please advise on how to enable file deletion on free tier?

The only reason a delete should fail is if the file isn’t actually there. (There are other reasons, like permissions issues, but that’s unlikely to be relevant here.)

Did the put() actually work?

Can you verify the file is there before deleting it?

You are right! but then why isn’t the image changeing on the front-end when i delete and upload an image with the same name? It seems to be a cache issue, shift+f5 loads the new Pic. How to froce that on render?

Most frameworks have a server-side caching system built in, I’m sure Laravel does, I don’t know the specific details of it. However, Shift+F5 would point to a browser-cache, it wouldn’t surprise me that Laravel sends client-caching headers with the asset, though there may be something more implicit causing this. In any case, it’s worth exploring Laravel’s docs for more information.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.