plank / laravel-mediable

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel
MIT License
772 stars 101 forks source link

detach relations does not work on delete #339

Open ehsan-soleimanian opened 9 months ago

ehsan-soleimanian commented 9 months ago

I'm wondering why detaching all realtion should only work on SoftDeletes procedure while it dose make sense when a file deleted then all relations on Mediable table should be removed and detach. Am I wrong ? If not I can make pull request to solve this.

frasmage commented 7 months ago

The mediables pivot table is configured to cascade deletions from the media table at the MySQL level (soft deletes don't actually remove anything, so it requires custom logic). Deleting a media record should automatically sever that link. Are you saying this is not occurring for you?