Recent uploaded images are NOT deleted
I have noticed that whenever I upload a file and DELETE it in that post the recently uploaded image is not being deleted from storage/public directory:
This can make the application heavy in terms of the space that should be dedicated to it.
That's a known issue. I'll see what I can do about getting it into a future release.
I have an idea about it.
You get the file names in the storage folder. Then you check your database.
In your database canvas_posts in the body column, you should see if that image name exists in any of those records.
As far as the query can be heavy enough to make the application slow it can be done through Laravel scheduler (once a day or whatever).
I'd be happy if you assign this task to me so that I'll be able to fix it.😊
I think the better route to go for this would be to handle this in the Vue components, specifically where we have methods that remove images. There, you could hit a single DELETE route with the filename, do a quick lookup in the MediaController, and return the proper response after the action is taken.
Let me know what you think, I'll assign this to both of us and I'll be more than happy to check out a PR once you've got one ready!
Is this bug already fixed for a future release? Can I help to fix it?
Thanks @Khanabeev for offering that, SUPER helpful!
It's still an open bug, so if you'd like to take a stab at it and submit a PR, I'd be more than happy to take a look.