incompass/soft-deletable-bundle
A Symfony bundle that adds soft-delete support to Doctrine entities. Mark records as deleted without removing them from the database, automatically filter them from normal queries, and restore them when needed, helping preserve data history and build safer deletion workflows.
SoftDeletes trait already covers delete(), restore(), forceDelete(), withTrashed(), and onlyTrashed(). There is no capability gap to buy.deleted_at, table growth, and archive/partitioning strategy. These costs exist regardless of which implementation is chosen.Adopt only if all of the following hold:
SoftDeleteable for a specific, documented reason.Look elsewhere — strongly — in these cases:
SoftDeletes trait. This package adds nothing and does not apply. Even in a Laravel app that uses Doctrine via laravel-doctrine/orm, the bundle will not auto-register and would require a custom service provider to wire its event subscriber — reverse-engineering an unadopted package to replicate a feature you can get in one line.gedmo/doctrine-extensions (SoftDeleteable) with stof/doctrine-extensions-bundle is the established option, with active maintenance, documentation, and a large install base.restore(), forceDelete(), withTrashed(), and onlyTrashed() out of the box; here you write those yourself and toggle the filter manually.Default recommendation: do not add this dependency. Implement in-house (a trait or Doctrine listener plus a query filter), or use Gedmo on Symfony/Doctrine. The in-house cost is roughly one engineering day and eliminates the dependency entirely.
For executives: We evaluated incompass/soft-deletable-bundle for recoverable deletes and retention. It is not recommended. The capability itself is valuable — users expect undo-delete, and retaining rows supports historical reporting and referential integrity — but this specific package shows no ecosystem traction (zero stars, zero known dependents, no visible maintenance), and the feature is small enough to build ourselves in about a day. On Laravel, the framework already ships this natively. Adopting unvetted third-party code to save one day creates ongoing security and maintenance exposure with no offsetting benefit, and would also commit us to owning a fork with no upstream support.
For engineering: Note the stack mismatch first — this targets Doctrine entities, so it is a Symfony bundle, not a Laravel package. On Laravel we would simply use Eloquent's native SoftDeletes trait; there is no gap to fill. On Symfony/Doctrine, the maintained option is Gedmo's SoftDeleteable via StofDoctrineExtensionsBundle, or a small custom listener plus SQL filter. Whichever route we take, plan for the known edge cases up front: unique constraints must account for soft-deleted rows; default query filtering must be explicit and consistent, because raw SQL and batch jobs bypass the ORM filter and will leak deleted records; and we need a hard-delete/purge path for retention and privacy obligations. Note also that the most dangerous failure mode of a Doctrine soft-delete subscriber is silent — if the subscriber is misconfigured, remove() becomes a permanent hard delete, so any implementation needs an integration test asserting the row survives deletion. Recommended decision: do not add this dependency; proceed with the framework-native feature or a ~1-day in-house implementation.
How can I help you explore Laravel packages today?