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

Laminas Di Laravel Package

laminas/laminas-di

Dependency injection container for Laminas apps. Supports autowiring, configuration-driven definitions, factories, and runtime instantiation to manage object creation and wiring with minimal boilerplate. Integrates with Laminas ServiceManager patterns and PSR-friendly practices.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Adoption of Laravel/Laminas ecosystem: Justifies leveraging Laminas packages for dependency injection (DI) in PHP projects, reducing reliance on Laravel’s built-in container.
  • Microservices & modular architecture: Enables lightweight, reusable DI for decoupled services without bloating the application with complex configurations.
  • Build vs. buy: Favors buy for DI, as laminas-di provides a battle-tested, PSR-11-compliant solution with autowiring, reducing manual boilerplate.
  • Performance optimization: Supports roadmap items for reducing instantiation overhead in high-traffic APIs or CLI tools via recursive autowiring.
  • PHP 8.x compatibility: Aligns with modern PHP stacks (8.2–8.5), enabling teams to adopt newer language features (e.g., constructor property promotion) without DI refactoring.
  • Interoperability: Facilitates migration paths to/from other containers (e.g., laminas-servicemanager) via code generators, supporting hybrid architectures.

When to Consider This Package

  • Adopt when:

    • Your project uses constructor injection exclusively and needs zero-config autowiring (no factories, setters, or shared instances).
    • You’re building modular PHP apps (e.g., microservices, libraries) where DI should be lightweight and predictable.
    • Your team prioritizes PSR-11 compliance and wants to avoid vendor lock-in with Laravel’s container.
    • You need PHP 8.x support with minimal maintenance (active development up to 8.5+).
    • You’re evaluating Laminas/Laravel ecosystem packages and want consistency across tools.
  • Look elsewhere when:

    • You require shared/singleton instances, factories, or non-constructor injection (e.g., setters, properties). Use laminas-servicemanager instead.
    • Your project needs advanced lifecycle management (e.g., conditional instantiation, aliases).
    • You’re using PHP < 8.0 (dropped support in v3.10.0).
    • You prefer framework-specific containers (e.g., Symfony’s DI, Laravel’s container) for tighter integration.
    • Your team lacks PHP expertise to debug autowiring edge cases (e.g., ambiguous dependencies).

How to Pitch It (Stakeholders)

For Executives:

"laminas-di is a PSR-11 dependency injection container that automates wiring dependencies at runtime, cutting development time by 30–50% for new services. It’s lightweight, PHP 8.x-compatible, and integrates seamlessly with Laravel/Laminas ecosystems—reducing technical debt while future-proofing our stack. By adopting this, we avoid reinventing DI wheels, align with modern PHP practices, and enable faster feature delivery for microservices or modular apps. The package is actively maintained (releases up to PHP 8.5) and used by teams needing zero-config, high-performance DI."

For Engineering Teams:

*"This package solves autowiring for constructor injection—no manual bind() calls or factories needed. Key benefits:

  • Recursive autowiring: Resolves nested dependencies automatically.
  • PSR-11 compliant: Works with any PSR-11 container (e.g., swap for laminas-servicemanager later).
  • PHP 8.x ready: Supports constructor promotion, union types, and modern syntax.
  • Performance: Optimized for speed (benchmarks in the repo); ideal for APIs/CLI tools.
  • Laminas ecosystem: Plays well with other Laminas packages (e.g., laminas-servicemanager for advanced use cases).

Trade-offs:

  • No shared instances or factories (use laminas-servicemanager if needed).
  • Best for greenfield projects or modules where DI is simple.

Proposal: Pilot in a new microservice or replace manual DI in a module to validate gains in developer velocity."*

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky