Askedio / laravel-soft-cascade

Cascade Delete & Restore when using Laravel SoftDeletes
https://medium.com/asked-io/cascading-softdeletes-with-laravel-5-a1a9335a5b4d
MIT License
705 stars 63 forks source link

Deleting Model with lots of relations exhausts memory. #127

Open Xodus-CO opened 3 years ago

Xodus-CO commented 3 years ago

Doing some testing with the softCascades and I delete a UserType Model with 9 relations. Some of those relations have 2-3 relations themselves, most have none. All relations/models have softDeletes added/enabled.

When I try deleting the vendor, it eventually dies out with Allocated memory exhausted. Currently its at 4GB, but there has to be a better/more efficient way? Or am wrong in thinking how this should work?

maguilar92 commented 2 years ago

You are free to make a PR with the improvement. I'm not using package anymore and only I will review PR's.