Weave 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

Dependency Injection Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for container plumbing. This package is a thin set of utility classes around Symfony's DI container. The decision it actually informs is whether small, single-purpose helpers around service instantiation, container access, or lazy wiring belong in our codebase or in a dependency. At 3 stars, 0 dependents, and a single release (Sept 2024), the answer is almost always "vendor the pattern, not the package."
  • Framework alignment check. Note the mismatch with our stated stack: the package targets Symfony, not Laravel. If we are evaluating it for a Laravel service provider or container extension, that is a stop-the-line finding before any roadmap slot is allocated. It is relevant only if we run Symfony services or a mixed PHP estate.
  • Standardizing DI ergonomics across services. The useful product question is whether our teams repeatedly hand-roll the same container helpers. If so, this repo is a reasonable reference implementation to inform an internal utility package we own, test, and version ourselves — reducing bespoke code without taking on an unmaintained dependency.
  • Testability and service locator discipline. Utilities that simplify pulling services from the container can quietly encourage service-locator anti-patterns. This package is a prompt to decide our stance: do we allow container access in application code, or restrict it to composition roots? That is an architecture policy decision worth making explicitly.
  • Roadmap / maintenance triage. With 0 dependents and minimal community validation, adopting it introduces a long-term ownership cost with no upstream safety net. That supports a "no roadmap impact" decision and frees capacity for higher-leverage work.
  • Use cases it could serve if adopted narrowly: small internal Symfony tools, legacy service wiring during a migration, or throwaway prototypes where wiring speed matters more than long-term maintainability.

When to Consider This Package

Consider it only when all of the following hold:

  • The codebase is Symfony-based (or we have a genuine Symfony component in the stack); it does not apply to a standard Laravel application, where the framework container and app() helpers already cover this ground.
  • We have a concrete, named pain point — specific repetitive container boilerplate — rather than a general desire to "improve DI."
  • We are comfortable owning the code: forking it, pinning it, and taking responsibility for security patches and PHP-version upgrades, since upstream activity is minimal.
  • The scope is non-critical: internal tooling, prototypes, or migration scaffolding where a failure is recoverable.

Look elsewhere when:

  • Laravel is the target — use the framework container, service providers, and contextual binding; no third-party package needed.
  • Symfony is the target — Symfony's own DI component, autowiring, service locators, and compiler passes are the maintained, documented path. PHP-DI is the mature alternative if we want a PSR-11 container with broader adoption.
  • Production-critical wiring is involved — a package with 3 stars and 0 dependents cannot be a dependency of anything customer-facing.
  • We need active maintenance guarantees — no meaningful release cadence, no visible issue triage, no dependents to surface breakage.
  • We need documentation and support — none is evident; onboarding cost lands entirely on us.

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.

How to Pitch It (Stakeholders)

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.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core