Application
interface Application implements Container (View source)
Methods
Assign a set of tags to a given binding.
Register a binding with the container.
Bind a callback to resolve with Container::call.
Register a binding if it hasn't already been registered.
Register a shared binding in the container.
Register a shared binding if it hasn't already been registered.
Register a scoped binding in the container.
Register a scoped binding if it hasn't already been registered.
Register an existing instance as shared in the container.
Add a contextual binding to the container.
Get a closure to resolve the given type from the container.
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.
Register a new before resolving callback.
Register a new resolving callback.
Register a new after resolving callback.
Get the version number of the application.
Get the base path of the Laravel installation.
Get the path to the bootstrap directory.
Get the path to the application configuration files.
Get the path to the database directory.
Get the path to the language files.
Get the path to the public directory.
Get the path to the resources directory.
Get the path to the storage directory.
Get or check the current application environment.
Determine if the application is running in the console.
Determine if the application is running unit tests.
Determine if the application is running with debug mode enabled.
Get an instance of the maintenance mode manager implementation.
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.
Resolve a service provider instance from the class name.
Boot the application's service providers.
Register a new boot listener.
Register a new "booted" listener.
Run the given array of bootstrap classes.
Get the current application locale.
Get the application namespace.
Get the registered service provider instances if any exist.
Determine if the application has been bootstrapped before.
Load and boot all of the remaining deferred providers.
Set the current application locale.
Determine if middleware has been disabled for the application.
Register a terminating callback with the application.
Terminate the application.
Details
void
bind(Closure|string $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding with the container.
void
bindMethod(array|string $method, Closure $callback)
Bind a callback to resolve with Container::call.
void
bindIf(Closure|string $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding if it hasn't already been registered.
void
singleton(Closure|string $abstract, Closure|string|null $concrete = null)
Register a shared binding in the container.
void
singletonIf(Closure|string $abstract, Closure|string|null $concrete = null)
Register a shared binding if it hasn't already been registered.
void
scoped(Closure|string $abstract, Closure|string|null $concrete = null)
Register a scoped binding in the container.
void
scopedIf(Closure|string $abstract, Closure|string|null $concrete = null)
Register a scoped binding if it hasn't already been registered.
TInstance
instance(Closure|string $abstract, TInstance $instance)
Register an existing instance as shared in the container.
void
addContextualBinding(string $concrete, Closure|string $abstract, Closure|string $implementation)
Add a contextual binding to the container.
mixed
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
Call the given Closure / class@method and inject its dependencies.
void
beforeResolving(Closure|string $abstract, Closure|null $callback = null)
Register a new before resolving callback.
void
resolving(Closure|string $abstract, Closure|null $callback = null)
Register a new resolving callback.
void
afterResolving(Closure|string $abstract, Closure|null $callback = null)
Register a new after resolving callback.
string|bool
environment(string|array ...$environments)
Get or check the current application environment.
ServiceProvider
register(ServiceProvider|string $provider, bool $force = false)
Register a service provider with the application.
void
registerDeferredProvider(string $provider, string|null $service = null)
Register a deferred provider and service.
ServiceProvider
resolveProvider(string $provider)
Resolve a service provider instance from the class name.
array
getProviders(ServiceProvider|string $provider)
Get the registered service provider instances if any exist.
Application
terminating(callable|string $callback)
Register a terminating callback with the application.