clear() function deleting media records from database #3261
Unanswered
KateyBoster
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a collection setup for images and am trying to have the uploader remove any past files from the list once a new one is uploaded. This is using the media library pro package with Laravel Livewire.
I am trying to achieve the functionality that when a new file is uploaded, the existing file is hidden but not deleted.
As it is, all files remain visible.
When I use the
$this->clearMedia()
function it deletes the records fully from the database, however according to the documentation, it shouldn't actually delete the files.https://spatie.be/docs/laravel-medialibrary/v10/handling-uploads-with-media-library-pro/handling-uploads-with-livewire
Thank you for any help!
Beta Was this translation helpful? Give feedback.
All reactions