cesargb/laravel-cascade-delete
Post and all its Comments across multiple models like BlogPost, ForumPost, etc.).User → Post/Comment/Media).Page, Article) shares polymorphic relations (e.g., Asset, Tag).Adopt if:
MorphOne, MorphMany, MorphToMany) and requires automated cascading deletes to maintain referential integrity.ON DELETE CASCADE for polymorphic relations.delete() calls in controllers/services).Look elsewhere if:
cascadeOnDelete or SoftDeletes).For Executives: "This package lets us automatically delete related data (e.g., comments, media) when a parent record is deleted—without writing custom code. For example, if a user deletes a polymorphic post (like a blog entry or forum thread), all associated comments and attachments vanish instantly. It’s a 10-minute install that replaces hours of manual cleanup logic, reducing bugs and dev time. Perfect for scaling our content-heavy features like [Product X]."
For Engineers:
"Need to handle polymorphic cascading deletes in Laravel? This trait (CascadeDelete) replaces boilerplate observers with a single line per model. Supports MorphOne, MorphMany, and MorphToMany out of the box. Just add the trait and define cascadeDeleteMorph with your relation methods—no SQL ON DELETE hacks. Works with Laravel’s soft deletes too. Lightweight, tested, and MIT-licensed. Let’s cut our delete-related tech debt by 30%."
How can I help you explore Laravel packages today?