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

:sheep: A flexible dependency injection container; It is an implementation of PSR-11

Frequently asked questions about Di
What is slince/di and is it PSR-11 compatible?
slince/di is a lightweight dependency injection container for PHP and an implementation of PSR-11. It provides constructor and setter injection, service providers, aliases, lazy loading, and shared instances. PSR-11 compatibility means it exposes the standard get() and has() methods, but behavior beyond those methods is package-specific.
How do I install slince/di with Composer?
Install it with composer require slince/di. Then instantiate the container, register your bindings, and resolve services through get(). The install is trivial; the important work is deciding where the container owns object construction and where Laravel's container remains in charge.
Can I use slince/di as Laravel's container?
No. Laravel already ships Illuminate\Container\Container, which implements PSR-11 and integrates with app(), facades, controller injection, commands, and service providers. Using slince/di inside a Laravel request lifecycle would mean running two containers and two object graphs, which is an architectural loss.
Does slince/di support Laravel service providers or facades?
slince/di has its own service provider concept, but it does not plug into Laravel's service provider pipeline or facades. Laravel resolves facades and method injection through its own container, and a second container cannot participate in those paths. Adoption is therefore limited to code you construct explicitly.
Does slince/di support autowiring and constructor injection?
The overview lists constructor and setter injection but does not mention autowiring. PSR-11 only standardizes get() and has(), not constructor parameter resolution or factory ergonomics. Verify autowiring support in the source and test suite before relying on it.
Does slince/di support singletons, aliases, and lazy loading?
Yes, the package description lists shared instances, aliases, lazy loading, service providers, and constructor and setter injection. These features are package-specific rather than part of PSR-11. Document singleton versus transient semantics carefully, because they can differ from Laravel's container.
Is slince/di safe for production Laravel applications?
Treat it as a supply-chain risk for a central object-construction dependency. The available signals are weak: roughly 20 stars, an unknown repository, and limited visible maintainer depth. For production Laravel applications, Illuminate\Container is the safer default; consider slince/di only for a constrained, framework-agnostic boundary.
What Laravel or PHP versions does slince/di support?
The provided context does not specify supported PHP or PSR-11 versions, and the repository is listed as unknown. That is a real concern when upgrading PHP majors. Check the composer.json, CI matrix, and open issues before committing.
When should I use slince/di instead of Illuminate\Container?
Use it only outside the Laravel request, job, or command lifecycle, such as a distributable framework-agnostic package or a standalone CLI tool that intentionally avoids illuminate/*. Even then, first rule out plain constructor injection, a hand-written factory, or psr/container with a minimal in-house implementation. Inside Laravel, use Laravel's container.
How does slince/di handle circular dependencies and container exceptions?
The provided overview does not document circular-dependency handling, exception types, or singleton/transient edge cases. Those behaviors are not standardized by PSR-11 and will likely differ from Laravel's container. Inspect the test suite and source before depending on them, and add tests around any circular or shared-instance scenarios.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager