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

Di Laravel Package

slince/di

A lightweight, PSR-11 compatible dependency injection container for PHP. Slince DI supports constructor and setter injection, service providers, aliases, lazy loading, and shared instances, giving you a simple, flexible foundation for managing object dependencies in small to medium applications.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

slince/di is a standalone PSR-11 service container. Laravel already ships one: Illuminate\Container\Container implements Psr\Container\ContainerInterface, plus autowiring, contextual binding, method injection, tags, service providers, deferred providers, and container events. That overlap is the core finding — for a Laravel application, this package competes with a capability the framework provides for free and integrates more deeply.

The only architecturally defensible fit is outside the framework boundary:

  • Framework-agnostic libraries or SDKs we publish that must not depend on illuminate/*.
  • Standalone CLI tools, workers, or queue consumers that intentionally avoid booting the framework.
  • A bounded context that is deliberately isolated behind a PSR-11 seam so it can be reused across Laravel and non-Laravel runtimes.

Inside a Laravel request lifecycle, adopting this package means running two containers with two object graphs. That is a net architectural loss, not a gain.

Integration feasibility

Low-to-moderate. Technically trivial — composer require slince/di, instantiate the container, register bindings — but the integration work is not the install, it is the boundary discipline:

  • PSR-11 only standardizes get() and has(). It says nothing about autowiring, constructor parameter resolution, factories, delegates, or configuration ergonomics. Any behavior we rely on beyond get/has is package-specific and non-portable.
  • Bridging the two containers in either direction requires an adapter and a documented rule about which container owns which service. Undocumented dual ownership is where this goes wrong.
  • Laravel's container is resolved via app(), facades, and controller/command method injection. A second container cannot participate in those paths, so adoption is necessarily confined to explicitly constructed code.

Technical risk

The dominant risk is supply chain, not code. The signals are weak: ~20 stars, "repository: unknown," a 0.55 composite with a 0.38 opportunity score, and no visible maintainer depth. For a dependency that sits at the center of object construction, low adoption and low activity translate directly into:

  • Abandonment risk — no guaranteed PHP version support as we upgrade majors.
  • Security posture — no established disclosure process or audit trail.
  • Behavioral divergence — singleton/transient semantics, circular-dependency handling, and exception types will differ from Laravel's container. Subtle state duplication (two "singletons" of the same class) is a realistic and expensive bug class.
  • Bus-factor — effectively no community to escalate to; we would be the maintainers of last resort.

Key questions

  1. Is the repository actively maintained, and what PHP and PSR-11 versions are supported?
  2. Does it support autowiring, factory closures, and instance registration — or only explicit bindings?
  3. Does it support container compilation or caching, and what is the cold-start cost at our binding count?
  4. Are singleton vs. transient semantics documented, and how are circular dependencies surfaced?
  5. Is there a CI matrix and test suite we can inspect before committing?
  6. What is the license, and is it compatible with our distribution model (SaaS vs. redistributed package)?
  7. Is there a concrete module that cannot use Illuminate\Container — or is this adoption driven by preference rather than constraint?

Integration Approach

Stack fit

Poor for in-app use, acceptable for out-of-app use. Decision rule to propose: if the code runs inside a Laravel request, job, or command, it uses Laravel's container. If the code is a distributable package or a standalone binary, slince/di is a candidate — and even then, only if we have ruled out a lighter seam (plain constructor injection, or a hand-written factory) and ruled out psr/container with a minimal in-house implementation.

Migration path

There is no migration path, because there should be no migration. Do not attempt to replace Illuminate\Container. If we adopt at all, it is greenfield and additive:

  1. Identify one isolated, non-critical component with no framework coupling today.
  2. Introduce slince/di behind a PSR-11 interface so the concrete container is swappable.
  3. Keep the container instance out of the Laravel service provider graph — construct it explicitly at that component's entry point.
  4. Timebox the spike; measure developer friction, not just whether it runs.

Compatibility

Two dimensions to verify before any code is written:

  • Runtime: PHP version floor/ceiling against our supported matrix; PSR-11 interface version against psr/container already in our lockfile. A mismatch here causes a Composer conflict that blocks unrelated upgrades.
  • Semantic: binding lifetime (singleton/transient), lazy resolution, and error types must be documented against Laravel's behavior so developers do not carry over incorrect assumptions.

Sequencing

Run this as a timeboxed spike, not a commitment. Sequence:

  1. One-week technical spike in a non-production-adjacent component; validate API shape, PHP support, and behavior under circular dependencies.
  2. Decision gate: does the component genuinely require framework independence? If no, stop.
  3. If yes: wrap behind PSR-11, add a contract test, pin the version exactly, and document the boundary in the architecture decision record.
  4. Reassess quarterly against maintenance signals; have a fork-and-own contingency ready.

Operational Impact

Maintenance

This is the largest cost and it is asymmetric — we take on an unmaintained dependency to save writing a small amount of constructor wiring. Mitigations: pin to an exact version, vendor the source into our monorepo (or a private fork) if the component becomes load-bearing, and assign an explicit internal owner. Budget realistically: a low-activity DI container is a recurring "who owns this at the next PHP major?" line item.

Support

Community-only, and thin. With ~20 stars there is no meaningful ecosystem for answers, and no commercial backing. Our internal team is the effective support tier. Contrast with Illuminate\Container, where we already have institutional knowledge and every Laravel developer we hire arrives competent in it.

Scaling

Runtime scaling is a non-issue — container resolution is cheap relative to I/O. The scaling concern is cognitive and organizational: two DI systems means two sets of idioms, two debugging mental models, and onboarding cost for every new engineer. That cost compounds with team size, whereas the benefit does not.

Failure modes

  • Duplicate singletons — the same class registered in both containers yields two instances, silently breaking state assumptions (especially with caches, counters, and connection pools).
  • Inconsistent resolution errors — different exception types surface as uncaught or mis-classified errors in our monitoring; NotFoundExceptionInterface vs. Laravel's BindingResolutionException will not map cleanly.
  • Circular dependency blind spots — handling may differ, turning a startup failure into a runtime failure deep in a request.
  • Silent abandonment — no deprecation warning when the package stops tracking PHP releases; breakage appears at upgrade time as a Composer conflict.
  • Boundary erosion — the most likely failure is gradual, unplanned creep of the second container into framework-managed code, at which point the isolation rationale has evaporated.

Ramp-up

Near-zero to install, meaningful to operate. Any Laravel developer can call get(); almost none will know this package's lifetime semantics, caching behavior, or error model without reading source. Documentation quality is unknown and probably thin given adoption. Factor in a half-day of exploration per engineer and a short written standard for where the container may be used — the standard matters more than the training.

Bottom line for the portfolio decision

Recommend do not adopt for Laravel application code; the package duplicates a framework capability with worse integration and unsupported maintenance risk. Hold it as a conditional candidate only for framework-agnostic components, contingent on a one-week spike answering the maintenance, PHP-support, and semantics questions above. The 0.55 composite and 0.38 opportunity scores are consistent with this read: technically functional, strategically low-value.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator