adonis-lucid-soft-deletes icon indicating copy to clipboard operation
adonis-lucid-soft-deletes copied to clipboard

Soft delete-Cascading Related Models

Open sirolad opened this issue 3 years ago • 1 comments

Its awesome that we have are able to soft deleted, sometime we need to cascade soft-delete to related models, something like this https://github.com/Askedio/laravel-soft-cascade

sirolad avatar Nov 22 '20 17:11 sirolad

Thanks, @sirolad, for the suggestion.

Cascading soft deletes look like something that could have a use case; however, I have some concerns about it.

The cascading soft-deletes support brings another level of complexity. This package already makes some hacking and monkey-patching in the Adonis. I'd rather avoid making more changes than it's required to do soft-deletes work.

Second thing - I'm worried that this is a bad dev UX. I'm concerned mostly about the cascading restoration of the models. What if it restores too much (i.e., records that were deleted before the soft delete cascade)? I think this might generate more confusion as it brings any benefit.

Having that said, maybe I should update the package in a way that allows better integrations for plugins?

radmen avatar Nov 23 '20 09:11 radmen