Cascading deletes for Eloquent models that implement soft deletes
1.2k
Stars
88
Forks
1
Open issues
18
Contributors
AI Analysis
This package enables cascading soft deletes for Laravel Eloquent models, allowing parent records to automatically soft-delete their related child records while maintaining the ability to restore everything together. It solves the gap between database-level CASCADE constraints (which hard-delete) and Laravel's soft-delete feature. This is a specialized tool for Laravel developers building applications with complex data relationships that require recoverable deletions.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Trait that adds cascading soft-delete logic to Laravel Eloquent models, solving a real ORM gap
laravel-cascade-soft-deletes is a Laravel package that enables automatic cascading deletion of related records when a parent model is soft-deleted. It solves a specific problem: Laravel's soft-delete feature blocks database-level cascading deletes, leaving developers to manually cascade or lose referential integrity. The package is used in Laravel applications that combine soft-deletes with hierarchical data (posts→comments, orders→items). Adoption appears steady but niche—the problem it solves is real but only affects a subset of Laravel developers.
Created in 2016 as a direct response to a gap in Laravel's soft-delete semantics. The package has remained narrowly focused on this single problem for a decade, with incremental updates tracking Laravel version compatibility. No major feature drift or scope expansion observed.
The package gained 1,178 stars over 10 years at a steady, flat rate—approximately 118 stars per year, or roughly one adopter per week. Recent activity (0 stars in last 7 days as of 2026-07-03) suggests mature plateau rather than active growth. The similar repos listed (parental, eloquent-sluggable, adjacency-list) occupy adjacent niches and have 1.5–3.4× higher stars, but this package is not trailing them significantly—it may serve a sufficiently differentiated problem.
Adoption not verified. Package shows 1,178 GitHub stars and mentions 'Total Downloads' badge on Packagist, but README does not include concrete download counts, production case studies, or named users. Stars alone are not sufficient evidence of real-world usage at scale. The package may have quiet, steady adoption in small-to-medium Laravel projects, but quantifiable production metrics are absent.
Based on README, the package implements a single trait (CascadeSoftDeletes) that hooks into the Eloquent `deleting` event. It likely iterates over defined relationships and calls delete() recursively on child records. The README documents multiple fetch strategies (get, cursor, lazy, chunk) suggesting awareness of memory/performance tradeoffs. No heavy framework modifications or breaking Eloquent assumptions are apparent.
README references a GitHub Actions workflow (run-tests badge), indicating automated test coverage exists. Details of test scope, coverage percentage, or test count are not documented in README.
Last push 2026-03-20 (3+ months ago as of 2026-07-03). Build badge is active and linked to GitHub Actions. No unresolved critical issues mentioned in README. The maintenance rhythm appears slow but deliberate—likely maintenance releases only when Laravel versions change or bugs are reported. This is consistent with a mature, stable package addressing a stable problem.
ADOPT IF: your Laravel app uses soft-deletes on hierarchical data (parent-child relationships) and you need child records to delete when parent is soft-deleted, and your team can handle the known limitation that restored parents do not restore deleted children. AVOID IF: you need hard-delete cascading (hard deletes, not soft), or your data model is flat (no cascading relationships), or you prefer database-level foreign key constraints for all cascade logic. MONITOR IF: you are a Laravel user considering soft-deletes and unsure whether this package's cascading approach will conflict with your restoration strategy—test the parent-restore behavior first.
Independent dimensions
Mainstream potential
3/10
Technical importance
6/10
Adoption evidence
3/10
- No way to track which child records were cascade-deleted vs. independently deleted—restoring a parent does not restore its children, creating potential data orphaning scenarios.
- Recursive cascade on deeply nested hierarchies could cause memory or query-execution timeouts without careful chunk-size tuning; developer must be aware of performance implications.
- Adoption is not publicly verified at scale; if used in large production systems, issues may not be immediately visible in public issue tracker.
- Tight coupling to Laravel version and Eloquent internals; if Eloquent's deletion event system changes significantly, package may require urgent updates.
- Single maintainer (based on GitHub username and typical open-source pattern); bus-factor risk if maintainer becomes unavailable.
Package will remain a stable, slowly-maintained niche tool. Unlikely to see rapid growth or major feature additions. Most likely scenario: continues to receive version-compatibility updates (Laravel 11, 12, etc.) as Laravel evolves, but no substantial architectural changes. May eventually be superseded if Laravel's core adds native cascading-soft-delete support, but that is not expected in near term.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- https://dyrynda.com.au
- Language
- PHP
- License
- MIT
- Last updated
- 4mo ago
- Created
- 124mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
No open issues — clean slate.
Top contributors
Recent releases
Similar repos
mike-bronner/laravel-model-caching
This package adds automatic, self-invalidating caching to Laravel Eloquent...
lazychaser/laravel-nestedset
A Laravel package that implements the Nested Set Model for efficiently storing...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
1.2k | — | PHP | 8/10 | 4mo ago |
|
|
2.4k | — | Ruby | 8/10 | 3w ago |
|
|
2.4k | — | PHP | 9/10 | 2d ago |
|
|
3.8k | — | PHP | 7/10 | 3mo ago |
|
|
1.5k | — | PHP | 7/10 | 2mo ago |
|
|
2.9k | — | PHP | 9/10 | 4mo ago |
Broader scope: handles hierarchical tree structures; cascade-soft-deletes is narrower (generic relationship cascading). nestedset likely attracts developers building category/thread systems; cascade-soft-deletes serves general parent-child deletion needs.
Focuses on single-table inheritance patterns, not deletion cascading. Different problem domain; not a direct substitute.
Solves URL slug generation, orthogonal to this package's cascading-delete concern. Not a competitor.
Adjacency-list pattern for trees; similar audience (hierarchical data) but different implementation approach. May overlap use cases but are not substitutes.
In-memory collection-backed models; solves a different problem (no database). Not a competitor.