yokai/dependency-injection
yokai/dependency-injection is a lightweight Laravel/PHP package for managing class dependencies and service resolution, helping you bind, resolve, and inject objects through a simple container to keep application code cleaner and more testable.
Consider it only when all of the following hold:
app() helpers already cover this ground.Look elsewhere when:
Net recommendation: do not adopt as a dependency. Evaluate as a design reference, and only promote to a real dependency if a specific, bounded need appears and we accept fork ownership.
For executives: This is a very small, low-adoption open-source utility for PHP dependency injection. It is not a strategic investment and does not warrant roadmap capacity or budget. Our recommendation is to not add it as a dependency — the maintenance risk (single maintainer, no downstream users, sporadic releases) outweighs the modest convenience. We will keep a note of it as a reference for internal tooling if a need arises. Cost of the decision: effectively zero.
For engineering: Treat this as a pattern source, not a dependency. It illustrates lightweight helpers around Symfony's container, which may inform how we structure our own service wiring utilities. If we want DI ergonomics in Laravel, the framework container already provides them; in Symfony, use the native DI component or PHP-DI. If a specific use case emerges, we fork and own it — we do not pin production code to a 3-star package with zero dependents. Please flag any team currently reaching for container-locator shortcuts so we can address the underlying design issue rather than paper over it with a helper library.
How can I help you explore Laravel packages today?