wernerdweight/doctrine-cascade-soft-delete-bundle
wernerdweight/doctrine-cascade-soft-delete-bundle adds cascade soft-delete support to Doctrine entities in Symfony, helping related records be marked as deleted alongside their parent while respecting entity associations and configurable cascade behavior.
Core problem it addresses: soft delete is an UPDATE, so database-level ON DELETE CASCADE never fires. Soft-delete a parent and its children stay "live" in the database — still appearing in listings, counts, exports, and reports, and creating referential inconsistency your queries have to defend against forever. This package cascades the soft-delete through Doctrine associations at the application layer.
Decisions it informs:
SoftDeletes plus model-event cascadeDeletes (or a small observer) is the equivalent, and several maintained Laravel packages cover it. Confirming the framework before any evaluation is the single highest-value check a PM can make here.Consider it when:
Look elsewhere when:
SoftDeletes with model events, an observer, or a maintained Laravel cascade-soft-delete package.ON DELETE CASCADE territory plus an audit table; this package does not simplify it.To executives — the one-paragraph version: When we "delete" a record in this system we usually only hide it, so the database no longer removes the records that belonged to it. The result is that deleted projects, accounts, or workspaces keep contributing rows to reports, counts, and exports — numbers quietly drift and support gets tickets about data that should be gone. This package makes that cleanup automatic and consistent. It is a small, unmaintained open-source library with no adoption, so the recommendation is not to depend on it — the recommendation is to treat it as a specification for roughly two days of our own engineering. Low cost, removes a whole class of correctness bugs, no vendor risk.
To engineering — the practical framing:
It is a Symfony/Doctrine bundle that hooks entity lifecycle events and propagates soft-delete to configured associations, because FK cascade constraints do not fire on UPDATE. It is exactly the right shape for our problem. It is also a one-person project, last released Feb 2023, no dependents, no CI signal we can verify against our Symfony/Doctrine versions. Proposal: do not add it to composer.json. Read it, use its attribute-driven API as the design, and implement the listener in-house against our own Doctrine version — with tests covering every association we soft-delete. If we later find ourselves reimplementing more than expected, we revisit a vendored fork with a named internal owner.
To the team as a product signal: The fact that this package exists, is MIT, and has essentially no users is informative in itself: cascade soft delete is a well-known sharp edge that almost nobody solves with a dependency. Plan for it as engineering work inside any "delete" feature, not as a library selection.
How can I help you explore Laravel packages today?