Spatie Media Library File Upload replacing every uploaded file
Hello, I have created a custom action for a file upload to my table, but when I upload a file it replaces all the already uploaded files. This hasn't been happening before.
After going through the code I found out the
My custom action:
After going through the code I found out the
deleteAbandonedFiles() method in the plugin, this gets called in the saveRelationshipUsing() method. It looks to me that only the uploaded file UUID gets added to the state so the rest of the files get deleted. But I'm not sure how to fix this.My custom action: