Application
interface Application implements Container
Methods
Assign a set of tags to a given binding.
Register a binding with the container.
Register a binding if it hasn't already been registered.
Register a shared binding in the container.
Register an existing instance as shared in the container.
Get a closure to resolve the given type from the container.
Call the given Closure / class@method and inject its dependencies.
Determine if the given abstract type has been resolved.
Get the version number of the application.
Get the base path of the Laravel installation.
Get or check the current application environment.
Determine if the application is currently down for maintenance.
Register all of the configured providers.
Register a service provider with the application.
Register a deferred provider and service.
Boot the application's service providers.
Register a new boot listener.
Register a new "booted" listener.
Get the path to the cached services.php file.
Details
in
Container at line 15
bool
bound(string $abstract)
Determine if the given abstract type has been bound.
in
Container at line 24
void
alias(string $abstract, string $alias)
Alias a type to a different name.
in
Container at line 33
void
tag(array|string $abstracts, array|mixed $tags)
Assign a set of tags to a given binding.
in
Container at line 41
array
tagged(array $tag)
Resolve all of the bindings for a given tag.
in
Container at line 51
void
bind(string|array $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding with the container.
in
Container at line 61
void
bindIf(string $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding if it hasn't already been registered.
in
Container at line 70
void
singleton(string|array $abstract, Closure|string|null $concrete = null)
Register a shared binding in the container.
in
Container at line 81
void
extend(string $abstract, Closure $closure)
"Extend" an abstract type in the container.
in
Container at line 90
void
instance(string $abstract, mixed $instance)
Register an existing instance as shared in the container.
in
Container at line 98
ContextualBindingBuilder
when(string $concrete)
Define a contextual binding.
in
Container at line 106
Closure
factory(string $abstract)
Get a closure to resolve the given type from the container.
in
Container at line 114
mixed
make(string $abstract)
Resolve the given type from the container.
in
Container at line 124
mixed
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
Call the given Closure / class@method and inject its dependencies.
in
Container at line 132
bool
resolved(string $abstract)
Determine if the given abstract type has been resolved.
in
Container at line 141
void
resolving(string $abstract, Closure $callback = null)
Register a new resolving callback.
in
Container at line 150
void
afterResolving(string $abstract, Closure $callback = null)
Register a new after resolving callback.
at line 14
string
version()
Get the version number of the application.
at line 21
string
basePath()
Get the base path of the Laravel installation.
at line 28
string
environment()
Get or check the current application environment.
at line 35
bool
isDownForMaintenance()
Determine if the application is currently down for maintenance.
at line 42
void
registerConfiguredProviders()
Register all of the configured providers.
at line 52
ServiceProvider
register(ServiceProvider|string $provider, array $options = [], bool $force = false)
Register a service provider with the application.
at line 61
void
registerDeferredProvider(string $provider, string|null $service = null)
Register a deferred provider and service.
at line 68
void
boot()
Boot the application's service providers.
at line 76
void
booting(mixed $callback)
Register a new boot listener.
at line 84
void
booted(mixed $callback)
Register a new "booted" listener.
at line 91
string
getCachedServicesPath()
Get the path to the cached services.php file.