korotovsky/gedmo-twig-softdeleteable-bundle
Symfony bundle that brings Gedmo SoftDeleteable into Twig, adding template helpers to detect and filter soft-deleted Doctrine entities. Keeps views clean by handling deleted records directly in templates without extra controller logic.
SoftDeleteable filter from inside a Twig template, so that a block of markup can render or query soft-deleted rows (trash bins, audit views, restore screens, "show archived" toggles). That is a try/finally around $em->getFilters()->disable('softdeleteable') wrapped in a Twig tag. Treat the decision as "do we vendor a dependency or write the extension ourselves," not as a platform choice.Consider it only if all of the following hold:
SoftDeletes with withTrashed() / onlyTrashed() query scopes and Blade templates, none of which this bundle touches.Look elsewhere — or write it yourself — when:
try/finally so the filter is always re-enabled) over an unmaintained bundle in the render path.EntityManager; disabling one mid-render can leak into any query executed during that window. If you cannot guarantee containment, don't adopt.Default recommendation: do not adopt. Have engineering write the equivalent extension in-house, or better, invert the design so controllers/services pass soft-deleted collections into the view. Either path removes the dependency entirely.
To executives: This is a tiny, unmaintained Symfony-only utility with no adoption (zero stars, zero dependents) that lets a template toggle a database filter. It is not a strategic dependency and carries no product differentiation. The capability it provides — showing archived/deleted records in admin screens — is real and already on our list; we can deliver it without this package. Recommendation: skip the dependency, build the ~30 lines internally, and avoid adding an unowned component to our render path.
To engineering: Scope is one Twig tag that wraps EntityManager::getFilters()->disable('softdeleteable'). Concerns to resolve before any adoption: (1) filter re-enablement must be try/finally-guaranteed; (2) Doctrine filters are shared mutable state on the EntityManager, so the tag's effect can bleed into sub-renders and any query inside the block — it cannot be scoped to "just this template"; (3) it moves a persistence concern into the view layer where it is hard to review and easy to misuse for authorization-sensitive visibility; (4) no observable maintenance. Preferred alternatives, in order: pass a pre-fetched collection into the template; otherwise a first-party Twig extension with explicit containment. If we do adopt, vendor the code and add a test that asserts the filter is restored after an exception.
How can I help you explore Laravel packages today?