phug/dependency-injection
Phug Dependency Injection is a lightweight PHP DI container offering autowiring, lazy service resolution, and flexible configuration for clean, testable applications.
Illuminate\Container. This package's PSR-11 surface makes that bridging decision concrete: we can register Laravel-resolved services into Phug's container rather than introducing a parallel dependency graph.Adopt it when:
Look elsewhere when:
Illuminate\Container doesn't already provide, and adding a second container is a net negative for cognitive load and debugging.To executives: This is a small, MIT-licensed plumbing component inside the Phug templating ecosystem — it's the piece that lets us add template features (custom filters, localization helpers, asset handling) cleanly instead of hard-coding dependencies into rendering code. It costs us nothing to adopt and reduces per-feature engineering effort, but it's a niche dependency with minimal community footprint, so we should treat it as an implementation detail behind our own interface rather than a platform commitment.
To engineering: It's a PSR-11 container with reflection-based auto-wiring, purpose-built for resolving Phug filters and extensions. The practical play is to register it as an adapter over Laravel's container so template extensions receive framework-managed services. Low risk, low cost, but isolated: pin the version, keep the integration behind a thin internal abstraction, and don't let Phug-specific container semantics leak into application code. If we're not on Phug, skip it — Laravel's container already covers this ground.
How can I help you explore Laravel packages today?