Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cascade Soft Deletes Laravel Package

iatstuti/laravel-cascade-soft-deletes

Laravel Cascade Soft Deletes adds an Eloquent trait that automatically cascades soft deletes, restores, and force deletes to related models, keeping parent and child records consistent without custom model event code.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping: Any feature that archives, deactivates, or removes a parent entity (e.g., deleting a team, project, workspace, category, or user) must define what happens to child records. This package supports a consistent “soft-delete the parent, soft-delete the children” behavior.
  • Roadmap sequencing: If the roadmap includes hierarchical data models with soft deletes, adopt early to avoid retrofitting cascading behavior across many models later.
  • Build vs. buy: Lean toward adoption. The logic is simple enough to build, but subtle enough (recursion, events, relationship types) that a small MIT package reduces custom-code risk. It is not a strategic differentiator, so avoid over-investing in a bespoke solution unless delete side effects are complex.
  • Use cases: Multi-tenant SaaS, CMS/content platforms, e-commerce catalogs, and compliance-sensitive apps where records must be retained but marked inactive. It helps prevent orphaned active child records and the support/analytics issues they cause.
  • Product risk: Low technical risk, but limited scope. Treat it as a tactical enabler, not a platform decision.

When to Consider This Package

  • Consider it when your Laravel app uses Eloquent soft deletes on both parent and child models, and you have clear one-to-many or many-to-many relationships where child records should follow the parent’s soft-deleted state.
  • Consider it when you want a convention-based, low-code approach and your delete flow does not require queued jobs, complex business rules, or per-child side effects.
  • Consider it when your team accepts small, focused third-party dependencies for cross-cutting concerns and you are on a supported Laravel version.
  • Look elsewhere when you do not use soft deletes; when you need hard-delete cascading (database foreign keys or Laravel’s migration-level cascades are better); when you need cascading restore behavior (this package focuses on deletes, not restores); when delete operations must be transactional across external systems, queued, or heavily audited; or when team policy prohibits micro-dependencies for logic you can reasonably own.

How to Pitch It (Stakeholders)

  • Executives: This is a low-cost, MIT-licensed utility that reduces data-integrity risk when users delete parent records. It helps prevent orphaned child data, inconsistent reporting, and support tickets, with no vendor lock-in. It is not a differentiator, but it is a sensible hygiene investment for products with hierarchical data.
  • Engineering: A simple Eloquent trait that cascades soft deletes from parent to configured child relationships. It is actively maintained and easy to trial in one domain (e.g., projects → tasks). Validate it against your delete/restore workflows, then standardize if it reduces custom code and orphaned-record bugs.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log