Media-Library-Plugin - do not replace existing media in collection #8674
diogogpinto
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
https://filamentphp.com/docs/3.x/forms/fields/file-upload#uploading-multiple-files |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all 👋🏻
If I'm correct, the spatie-laravel-media-library-plugin allows you to upload a file to a collection. But, if you want to add more files in the future, it currently deletes the files in existence.
Imagine the following workflow:
This is because of the saveRelationshipsUsing() method, that calls $component->deleteAbandonedFiles().
What I'm about to do is create a custom field, that extends this one, but with a property -> shouldDeleteOldFiles that when set to false doesn't call $component->deleteAbandonedFiles().
I don't know if this has many requests, but it's a simple feature request that I think can improve this plugin a lot.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions