The Container class implements the LaravelContainer interface and provides a dependency injection container for managing class dependencies and performing dependency injection.
addContextualBinding(): void
Add a contextual binding to the container.
afterResolving(): void
beforeResolving(): void
Register a binding with the container.
bindMethod(): void
Call the given function / class method and inject its dependencies.
createInstance<T>(constructor: new (...args: any[]) => T): T
flush(): void
Flush all of the container's bindings.
Register an existing instance as shared in the container.
register<T>(constructor: Constructor<T>,): void
Register a class and its dependencies with the container.
runAfterResolvingCallbacks(abstract: Abstract,instance: any,): void
runBeforeResolvingCallbacks(abstract: Abstract): void
runCallbacks(): void
runResolvingCallbacks(abstract: Abstract,instance: any,): void
Register a scoped binding in the container.
Register a scoped binding if it hasn't already been registered.
Register a shared binding in the container.
singletonIf(): void
Register a shared binding if it hasn't already been registered.
Assign a set of tags to a given abstract type(s).
when(concrete: Abstract): ContextualBindingBuilder
Define a contextual binding.