rickysu/di-extra-bundle
A Symfony bundle that adds annotation-based dependency injection configuration, letting you declare services, parameters, and injections directly in PHP classes instead of XML or YAML files.
Correct the framing before anything else. rickysu/di-extra-bundle is a Symfony 4 bundle, not a Laravel package. Laravel has no bundle loader, no compiler passes, and no Kernel::registerBundles(), so the package cannot execute inside a Laravel request lifecycle. That makes this a cataloguing/dependency-policy decision first, and a feature decision never. Scoped correctly (Symfony estates only), it informs:
ContextualAttribute, #[Singleton], #[Bind], $app->extend(), tags). The honest decision is "use the framework," always.Consider it only if all of the following hold:
Look elsewhere — usually at the framework itself — if any of these are true:
Illuminate\Support\ServiceProvider is a design exercise, not an integration.Also note the Composer-level blocker: a Symfony 4 bundle pins symfony/* to ^4.x, while Laravel 10/11 ship Symfony 6/7 components — resolution fails outright, and forcing it corrupts the framework's own dependency tree.
To executives: "We evaluated a small, single-maintainer Symfony add-on that was mis-filed as a Laravel package. It cannot run in our Laravel stack at all, and the convenience it offers has been built into Symfony and Laravel natively for years. It is not a strategic dependency, no product work depends on it, and the recommendation is no investment. If a retired Symfony 4 system ever surfaces, the answer is to finish migrating it — not to add a new dependency to it."
To engineering leadership: "This targets Symfony 4, which is end-of-life, and solves a problem the framework solved natively in 4.0 (autowiring) and 5.4 (attributes). Seven stars and zero dependents mean we'd be the only ones carrying it — estimate 2–5 engineer-days of remediation plus a recurring tax at every PHP and framework upgrade, with the real risk being 'magic' container behavior that's invisible in code review and slow to onboard. If a legacy Symfony 4 service is genuinely stuck mid-migration, allow a one-day timeboxed read of the source purely as a pattern catalog; then implement the two highest-value ideas as a ~150-line internal provider base class and measure boilerplate removed. Otherwise, standardize on framework-native DI."
Ask / next step: one named owner, a half-day gate to confirm no Symfony 4 estate is in scope, an architecture decision record closing the question so it doesn't resurface, and a default decision of do not adopt.
How can I help you explore Laravel packages today?