aura/di
Aura.Di is a serializable dependency injection container for PHP 8+ supporting constructor and setter injection, interface and trait awareness, configuration inheritance, and PSR-11 compliance. It has no external implementation dependencies and installs via Composer as aura/di.
Architecture fit. Aura.Di is a standalone, PSR-11-compliant container with constructor/setter injection, interface and trait awareness, config inheritance, lazy services, and — its distinguishing feature — a serializable/compilable container. Architecturally it is the opposite of Laravel's container philosophy. Illuminate\Container\Container is not a swappable component; it is the framework kernel. Facades, service providers, app()/resolve(), controller and middleware method injection, queued job and event listener hydration, Eloquent model resolution, and the when()->needs()->give() contextual binding API all depend on Illuminate\Contracts\Container\Container, which exposes roughly thirty methods (bind, singleton, scoped, instance, tag/tagged, extend, when, call, makeWith, factory, resolved, beforeResolving/afterResolving, rebinding, forgetInstance(s), flush, …). PSR-11 gives you only get() and has(). Substituting Aura.Di for the Laravel container is therefore not an integration task; it is a framework fork. Any evaluation that frames this as "replace Laravel's container" should be rejected at triage.
Where Aura.Di does fit: as the internal container of a framework-agnostic package or bounded context that must run identically inside Laravel, inside a standalone CLI worker, and inside a non-Laravel service in the same monorepo. There it is a reasonable, mature, zero-dependency choice.
Integration feasibility. Feasible in three narrow shapes, in ascending cost:
Illuminate\Container via instance()/bind(). Low risk, contained blast radius.Psr\Container\ContainerInterface implementation injected into a package, letting Laravel satisfy it through a delegate provider. Moderate risk; must verify no consumer calls non-PSR-11 methods.Illuminate\Contracts\Container\Container over Aura. High cost (~30 methods, plus correct semantics for extend, contextual bindings, rebinding hooks, and scoped lifetimes). Only justified if a hard requirement mandates one container for the whole app.Technical risk.
bin/auradi scan + #[Blueprint] compilation toolchain is newer and still stabilising.get()/newInstance(). Developers trained on Laravel's mutable, always-available container will hit this. It is documented and correct, but it is a recurring onboarding injury.#[Service], #[Instance], #[Value]) is elegant but invisible to IDE navigation and to Laravel-native debugging tooling (Telescope, artisan about, container dumps). Debuggability drops.psr/container ^2.0 — satisfiable alongside Laravel 10/11/12.Key questions.
composer/class-map-generator an install-time or build-only dependency? It determines whether it leaks into the app's production dependency tree.Stack fit. Composer-installable, PSR-4, MIT, no external implementation dependencies — it will co-install cleanly with Laravel and Symfony packages. It does not fight the framework; it simply sits outside it. Treat that as the design constraint rather than a limitation to overcome.
Migration path (strangler fig, not cutover).
Illuminate\Container. Keep the boundary one-directional: Laravel may ask Aura for things; Aura must never ask Laravel.Compatibility. Pin to ^5.0 with a committed lockfile; do not float across minors in production while the scan/compile path is still receiving correctness patches. Verify psr/container resolution against the app's Laravel minor before committing. Note the PHP 8.0 floor is below Laravel 11/12's 8.2 floor, so PHP version is a non-issue; the constraint that matters is psr/container major.
Sequencing recommendation. Do not proceed past the spike unless a measurable problem is being solved. The scoring signals here — 353 stars, 0 tracked dependents, opportunity score 21.5 — describe an adoption signal, not a quality signal. Code quality appears genuinely good (PSR-1/2/4/11 compliance stated, PHPStan, CI across PHP 8.4/8.5, maintained changelog). But with zero dependents you will find no prior art for Laravel integration and no community to lean on when the bridge misbehaves. Budget for owning that integration yourself.
Maintenance. Small-vendor, low-bus-factor risk. The Aura organisation maintains a family of packages with a long release history and an active 5.0.x cadence, but the contributor base is thin. Practical mitigation: pin the version, keep the PSR-11 boundary so replacement is cheap, and pre-negotiate a fork-and-maintain contingency (a competent PHP engineer can own a container this size). Upgrades between majors have historically been breaking-and-documented (2→3→4→5 each carry migration guides), which is a positive signal for planning.
Support. Community support runs through a Google Group and GitHub issues — no Slack, no Discord, no commercial backing. There is no vendor SLA. If your organisation requires a named escalation path for production components, this package fails that gate for anything on the critical path. That is the single strongest argument for restricting it to non-critical, boundary-scoped subsystems.
Scaling. Container performance is almost never the throughput bottleneck; the compiled container primarily reduces bootstrap latency in cold-start scenarios (per-request FPM, CLI invocations, ephemeral job runners). Under Octane the app boots once per worker, so the benefit largely evaporates. Do not sell this adoption on performance without a benchmark from your own application — and expect that benchmark to be underwhelming.
Failure modes to instrument for.
lazy*() variants.Ramp-up. A mid-level Laravel developer is productive in Laravel's container within days; Aura.Di's config-class model (params/setters/values arrays, ContainerBuilder, ContainerConfigInterface, configuration inheritance) is a genuinely different mental model. Estimate 1–2 sprints to fluency for the runtime container, and roughly double that for the attribute-scanning and blueprint-compilation path. Budget explicit onboarding documentation — none of it will be familiar, and the external docs, while complete, are oriented toward AuraPHP rather than Laravel.
Verdict. Adopt at the edge, not the core. Green-light a 1–2 week spike scoped to a framework-agnostic package; red-light any proposal to replace or wrap Illuminate\Container wholesale.
How can I help you explore Laravel packages today?