made with Laravel

Laravel Cascade Soft Deletes

Cascading deletes for Eloquent models that implement soft deletes

Visit Site

Description

Cascading deletes for Eloquent models that implement soft deletes

"In scenarios when you delete a parent record - say for example a blog post - you may want to also delete any comments associated with it as a form of self-maintenance of your data.

Normally, you would use your database's foreign key constraints, adding an ON DELETE CASCADE rule to the foreign key constraint in your comments table.

It may be useful to be able to restore a parent record after it was deleted. In those instances, you may reach for Laravel's soft deleting functionality.

In doing so, however, you lose the ability to use the cascading delete functionality that your database would otherwise provide. That is where this package aims to bridge the gap in functionality when using the SoftDeletes trait."


Creator

Michael Dyrynda
@michaeldyrynda


Social Media Links

Laravel Short Url Laravel URL Shortener
icon-eye-dark Created with Sketch. 5.405
Snooze Automate future notifications & reminders in Laravel
icon-eye-dark Created with Sketch. 664
Sentry for Laravel Laravel Error Monitoring
❤️ Sponsored by Friends
image-rocket Created with Sketch.
Launch your own rocket and submit your project!
Email Checker Email verification on the go
icon-eye-dark Created with Sketch. 631
Laravel Mail Preview Mail driver that saves sent mail to disk
icon-eye-dark Created with Sketch. 333
COMMUNITY SPONSORS