Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Di Laravel Package

aura/di

Aura.Di is a PSR-11 dependency injection container for PHP 8+ with constructor and setter injection, interface and trait awareness, configurable wiring with inheritance, and support for serialization. Installable via Composer and fully documented.

View on GitHub
Deep Wiki
Context7

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

Frequently asked questions about Di
Can I use Aura.Di as a drop-in replacement for Laravel’s built-in service container?
No, Aura.Di is not a direct replacement for Laravel’s container. Laravel’s container is deeply integrated with service providers, facades, and contextual binding—features Aura.Di lacks natively. Attempting to replace it would break core Laravel functionality without custom adapters.
Does Aura.Di support Laravel’s contextual binding or singleton groups?
No, Aura.Di does not support Laravel-specific features like contextual binding or singleton groups. These are core to Laravel’s container and would require manual workarounds or custom wrappers, increasing complexity and maintenance overhead.
Will Aura.Di work alongside Laravel’s container without conflicts?
Using both containers simultaneously is possible but risky. Laravel’s container relies on specific resolution patterns (e.g., facades, middleware), while Aura.Di discourages service locator anti-patterns. Conflicts in dependency resolution or binding precedence could lead to subtle bugs.
Are there performance benefits to switching from Laravel’s container to Aura.Di?
Aura.Di is lightweight and standards-compliant, but Laravel’s container is already optimized for its ecosystem. Without benchmark data showing measurable bottlenecks in Laravel’s container, switching to Aura.Di offers no proven performance advantage.
Does Aura.Di support PHP 8.4/8.5, and is it stable for production?
Yes, Aura.Di 5.0.9 adds PHP 8.4/8.5 compatibility and fixes edge-case attribute resolution bugs. However, its stability in Laravel projects is unproven—no production Laravel projects use it, and its generic design doesn’t address Laravel-specific edge cases.
How would I migrate a Laravel app from the native container to Aura.Di?
There’s no official migration path. You’d need to manually rewrite service providers, bindings, and facades to work with Aura.Di, which could break third-party Laravel packages (e.g., Spatie, Cashier) that rely on the native container.
Are there Laravel-specific packages or tools for integrating Aura.Di?
No, Aura.Di is framework-agnostic. Laravel’s ecosystem (Octane, Horizon, Forge) assumes the native container, so no official or community-supported adapters exist for Aura.Di in Laravel projects.
What alternatives to Aura.Di exist for Laravel’s dependency injection needs?
Laravel’s native container is the best choice for Laravel projects. For PSR-11 compliance outside Laravel, consider PHP-DI or League Container, but neither solves Laravel’s integration challenges. Avoid generic containers unless you’re building a non-Laravel PHP app.
Does Aura.Di support serialization of container instances?
Yes, Aura.Di supports serializable containers, which is useful for caching or distributed systems. However, Laravel’s container doesn’t serialize by default, so this feature is irrelevant unless you’re building a custom Laravel extension.
How do I test Aura.Di in a Laravel project without replacing the container?
You can use Aura.Di for non-Laravel dependencies (e.g., CLI commands, background jobs) by binding it to a specific namespace. However, avoid mixing it with Laravel’s container—this risks inconsistent resolution and violates Laravel’s architectural principles.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope