Replies: 2 comments 1 reply
-
That's why we had to create a small workaround. Having this in core would save our lives. |
Beta Was this translation helpful? Give feedback.
-
In general I try to avoid using cascade on relations as well as using But in this case the main problem with the restoring is how do you know what should be restored, for example:
If we restore all of them then obviously one is restored which shouldn't, even if we restore the ones with the same deleted_at time, we could run into problems with concurrent sessions. (Session A deleted the comment and session B deleted the post). And what should we do if there are multiple connections:
I'm not trying to say that this is a bad idea, just that it is a complex one. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Laravel do not support cascade delete with soft delete trait at the moment.
There is a 2 package for this job;
But both 2 packages is not perfect.
I think this feature is should be in Laravel core. We shouldn't include 3. part library.
Beta Was this translation helpful? Give feedback.
All reactions