service-container
Installation
SKILL.md
Laravel Service Container
When to use
- The user wants to bind an interface or abstract type to a concrete implementation so callers can type-hint the contract.
- The user wants Laravel to auto-resolve and inject a class's constructor dependencies instead of newing them up by hand.
- The user needs a single shared instance of a service reused for the whole request or worker lifetime.
When NOT to use
- Do not use the container to stash plain config scalars or arrays; use the config repository or env for values.
- Do not reach for the container to justify calling app() everywhere as a global service locator; prefer constructor injection.