michaeldyrynda

michaeldyrynda/laravel-cascade-soft-deletes

PHP MIT Web Dev Single maintainer risk

Cascading deletes for Eloquent models that implement soft deletes

1.2k stars
88 forks
slow
GitHub

1.2k

Stars

88

Forks

1

Open issues

18

Contributors

4.6.1 20 Mar 2026

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.

Web Dev Library Discovery value: 5/10
Documentation 8/10
Activity 6/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

laravel eloquent soft-deletes orm-extension database-relations
Actively maintained Well documented MIT licensed Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
1w ago

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.

Origin

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.

Growth

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.

In production

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.

Code analysis
Architecture

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.

Tests

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.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
100%

Information

Language
PHP
License
MIT
Last updated
4mo ago
Created
124mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Open issues

No open issues — clean slate.

Similar repos

jhawthorn

jhawthorn/discard

Discard provides a clean, convention-based approach to soft deletes in...

2.4k Ruby Web Dev
mike-bronner

mike-bronner/laravel-model-caching

This package adds automatic, self-invalidating caching to Laravel Eloquent...

2.4k PHP Web Dev
lazychaser

lazychaser/laravel-nestedset

A Laravel package that implements the Nested Set Model for efficiently storing...

3.8k PHP Web Dev
tighten

tighten/parental

Parental is a Laravel package that implements Single Table Inheritance (STI)...

1.5k PHP Web Dev
staudenmeir

staudenmeir/eloquent-has-many-deep

This Laravel package extends Eloquent's HasManyThrough relationship to support...

2.9k PHP Web Dev
vs. alternatives
laravel-nestedset (3,804 stars)

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.

parental (1,534 stars)

Focuses on single-table inheritance patterns, not deletion cascading. Different problem domain; not a direct substitute.

eloquent-sluggable (3,994 stars)

Solves URL slug generation, orthogonal to this package's cascading-delete concern. Not a competitor.

staudenmeir/laravel-adjacency-list (1,571 stars)

Adjacency-list pattern for trees; similar audience (hierarchical data) but different implementation approach. May overlap use cases but are not substitutes.

sushi (3,003 stars)

In-memory collection-backed models; solves a different problem (no database). Not a competitor.