- Is korotovsky/gedmo-twig-softdeleteable-bundle compatible with Laravel?
- No, not as a native Laravel package. It is a Symfony bundle that ships a Bundle class and DI extension and depends on Symfony Twig wiring plus the Gedmo SoftDeleteable Doctrine filter. A standard Laravel app using Eloquent and Blade has no matching integration point, so the package is effectively out of scope.
- How do I install this package with Composer in a Laravel application?
- Composer can download it, but Laravel will not auto-register the Symfony bundle, and there is no Laravel service provider, facade, or config file to publish. Making it work would mean bootstrapping Symfony bundle infrastructure inside Laravel's container, which is fragile and not recommended. The realistic path is to vendor the small filter-toggle logic instead of installing the dependency.
- Does this package work with Eloquent soft deletes?
- No. Eloquent soft deletes use the SoftDeletes trait and query scopes such as withTrashed() and onlyTrashed(), not a global Doctrine filter that can be toggled at runtime. This package only manipulates the Gedmo SoftDeleteable Doctrine filter, so it has no effect on Eloquent models.
- What Laravel and PHP versions are supported?
- There is no published Laravel compatibility matrix because this is not a Laravel package. Bundles of this vintage often pin older Symfony 2.x or 3.x and Gedmo releases, and compatibility with modern PHP 8.2+ and current Gedmo is unverified. Treat any Laravel or PHP version claim as unsupported until you test it yourself.
- Can I use this bundle with laravel-doctrine/orm and twigbridge?
- Technically the behavior is relevant if you use Doctrine entities, Gedmo extensions, and Twig via twigbridge, but the artifact is not. You would be hand-registering a Symfony bundle in a Laravel kernel rather than using a Laravel integration. Even in that rare stack, reimplementing the toggle as a Twig function registered through twigbridge is cleaner.
- How do I show soft-deleted records in a Laravel Blade or Twig view safely?
- Prefer passing an explicitly authorized collection to the view instead of toggling global ORM state during rendering. Add an explicit repository or query method such as findWithTrashed($id), authorize the request in the domain layer, and render the already-scoped result. This keeps filter state constant and avoids giving templates control over persistence visibility.
- Is it safe to disable Doctrine SoftDeleteable filters during template rendering in Laravel Octane or queue workers?
- It is risky. Doctrine filters are effectively global or request-scoped state, so a missed re-enable in a long-lived Octane worker or queue worker can leak soft-deleted rows into later unrelated queries. If you must toggle filters, wrap every path in try/finally and guarantee state reset at the request or worker boundary, but keeping the toggle out of templates is safer.
- Are there alternatives to this package for handling soft-deleted records in Laravel?
- For Eloquent, use the built-in SoftDeletes trait with withTrashed() and onlyTrashed() scopes, and authorize any admin-only views explicitly. For Doctrine via laravel-doctrine/orm, add a repository method that disables the filter in a try/finally block and returns the result. A custom Twig function through twigbridge is preferable to a Symfony bundle.
- Is this package actively maintained and tested?
- There are strong abandonment signals: zero stars, zero dependents, a single maintainer, and no visible test suite or CI. With no downstream consumers, breakage is unlikely to be detected upstream. Plan to own a fork or, more realistically, reimplement the roughly 20 to 30 lines of filter-toggle logic in your application.
- How do I test that the soft-delete filter state is restored after rendering?
- Write an integration test that resolves the EntityManager, checks the filter's enabled state before rendering, renders the block, and asserts the filter is enabled again afterward. Include an exception path test to prove your finally block restores state even when rendering fails. In Laravel, also verify behavior across simulated worker requests to catch state leakage.