intaro/twig-injection-bundle
Symfony bundle that injects container services into Twig templates, letting views call service methods directly instead of adding controller boilerplate. Configure exposed services and reuse them as handy view helpers for routing, formatting, and other presentation logic.
twig.yaml or copy-pasting vendor templates into the app. That directly supports a roadmap item like "third-party modules can ship UI without patching core."rcrowe/twigbridge and willing to carry Symfony's EventDispatcher and bundle bootstrapping. The actual decision it informs is narrower: "do we accept a Symfony component in our Laravel stack to solve template extensibility?" For a Blade-first app, the equivalent decision is View::addNamespace / a custom FileViewFinder / view composers — cheaper and native.Adopt (or, more likely, borrow the pattern) when all of the following hold:
^3.0): v3 is a breaking release, so an unpinned constraint is a future incident.Look elsewhere or build in-house when:
@Bundle/... overrides) and Twig namespaces cover most "override a vendor template" needs without a new dependency.Practical recommendation: prototype against it to validate the extension model, then decide whether to depend on it or reimplement the ~event-subscriber-plus-loader logic internally (likely a day or two of work) so we control the upgrade path. v3.0.0 does not change that calculus — it slightly reinforces it.
To executives: A small, MIT-licensed Symfony library that lets modules inject Twig templates through events rather than config edits. Strategically it de-risks the plugin/theming roadmap by removing the need to fork vendor code. Tactically it is low-cost and low-risk — but also low-signal: a handful of stars, no downstream dependents, one maintainer. The v3.0.0 release (PHP 7 and Symfony 3 support removed) confirms the project is maintained, not that it is supported. Frame it as a validated pattern we can adopt cheaply, not as infrastructure we bet the roadmap on.
To engineering: The value is the pattern — an event-driven hook into template resolution — not the code. If we're on Symfony + Twig, spend a day evaluating it against native bundle inheritance; if the fit is good, adopt at ^3.0 (the major drops PHP 7 / Symfony 3, so verify our runtime floor before upgrading) and keep a fork ready. If we're on Laravel/Blade, close the ticket: this is the wrong ecosystem, and the native equivalents are simpler and better supported.
How can I help you explore Laravel packages today?