interface Application implements Container

Methods

bool
bound(string $abstract)

Determine if the given abstract type has been bound.

void
alias(string $abstract, string $alias)

Alias a type to a different name.

void
tag(array|string $abstracts, array|mixed $tags)

Assign a set of tags to a given binding.

array
tagged(array $tag)

Resolve all of the bindings for a given tag.

void
bind(string|array $abstract, Closure|string|null $concrete = null, bool $shared = false)

Register a binding with the container.

void
bindIf(string $abstract, Closure|string|null $concrete = null, bool $shared = false)

Register a binding if it hasn't already been registered.

void
singleton(string|array $abstract, Closure|string|null $concrete = null)

Register a shared binding in the container.

void
extend(string $abstract, Closure $closure)

"Extend" an abstract type in the container.

void
instance(string $abstract, mixed $instance)

Register an existing instance as shared in the container.

when(string $concrete)

Define a contextual binding.

factory(string $abstract)

Get a closure to resolve the given type from the container.

mixed
make(string $abstract)

Resolve the given type from the container.

mixed
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)

Call the given Closure / class@method and inject its dependencies.

bool
resolved(string $abstract)

Determine if the given abstract type has been resolved.

void
resolving(string $abstract, Closure $callback = null)

Register a new resolving callback.

void
afterResolving(string $abstract, Closure $callback = null)

Register a new after resolving callback.

string
version()

Get the version number of the application.

string
basePath()

Get the base path of the Laravel installation.

string
environment()

Get or check the current application environment.

bool
isDownForMaintenance()

Determine if the application is currently down for maintenance.

void
registerConfiguredProviders()

Register all of the configured providers.

register(ServiceProvider|string $provider, array $options = [], bool $force = false)

Register a service provider with the application.

void
registerDeferredProvider(string $provider, string|null $service = null)

Register a deferred provider and service.

void
boot()

Boot the application's service providers.

void
booting(mixed $callback)

Register a new boot listener.

void
booted(mixed $callback)

Register a new "booted" listener.

string
getCachedServicesPath()

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.

Parameters

string $abstract

Return Value

bool

in Container at line 24
void alias(string $abstract, string $alias)

Alias a type to a different name.

Parameters

string $abstract
string $alias

Return Value

void

in Container at line 33
void tag(array|string $abstracts, array|mixed $tags)

Assign a set of tags to a given binding.

Parameters

array|string $abstracts
array|mixed $tags

Return Value

void

in Container at line 41
array tagged(array $tag)

Resolve all of the bindings for a given tag.

Parameters

array $tag

Return Value

array

in Container at line 51
void bind(string|array $abstract, Closure|string|null $concrete = null, bool $shared = false)

Register a binding with the container.

Parameters

string|array $abstract
Closure|string|null $concrete
bool $shared

Return Value

void

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.

Parameters

string $abstract
Closure|string|null $concrete
bool $shared

Return Value

void

in Container at line 70
void singleton(string|array $abstract, Closure|string|null $concrete = null)

Register a shared binding in the container.

Parameters

string|array $abstract
Closure|string|null $concrete

Return Value

void

in Container at line 81
void extend(string $abstract, Closure $closure)

"Extend" an abstract type in the container.

Parameters

string $abstract
Closure $closure

Return Value

void

Exceptions

InvalidArgumentException

in Container at line 90
void instance(string $abstract, mixed $instance)

Register an existing instance as shared in the container.

Parameters

string $abstract
mixed $instance

Return Value

void

in Container at line 98
ContextualBindingBuilder when(string $concrete)

Define a contextual binding.

Parameters

string $concrete

Return Value

ContextualBindingBuilder

in Container at line 106
Closure factory(string $abstract)

Get a closure to resolve the given type from the container.

Parameters

string $abstract

Return Value

Closure

in Container at line 114
mixed make(string $abstract)

Resolve the given type from the container.

Parameters

string $abstract

Return Value

mixed

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.

Parameters

callable|string $callback
array $parameters
string|null $defaultMethod

Return Value

mixed

in Container at line 132
bool resolved(string $abstract)

Determine if the given abstract type has been resolved.

Parameters

string $abstract

Return Value

bool

in Container at line 141
void resolving(string $abstract, Closure $callback = null)

Register a new resolving callback.

Parameters

string $abstract
Closure $callback

Return Value

void

in Container at line 150
void afterResolving(string $abstract, Closure $callback = null)

Register a new after resolving callback.

Parameters

string $abstract
Closure $callback

Return Value

void

at line 14
string version()

Get the version number of the application.

Return Value

string

at line 21
string basePath()

Get the base path of the Laravel installation.

Return Value

string

at line 28
string environment()

Get or check the current application environment.

Return Value

string

at line 35
bool isDownForMaintenance()

Determine if the application is currently down for maintenance.

Return Value

bool

at line 42
void registerConfiguredProviders()

Register all of the configured providers.

Return Value

void

at line 52
ServiceProvider register(ServiceProvider|string $provider, array $options = [], bool $force = false)

Register a service provider with the application.

Parameters

ServiceProvider|string $provider
array $options
bool $force

Return Value

ServiceProvider

at line 61
void registerDeferredProvider(string $provider, string|null $service = null)

Register a deferred provider and service.

Parameters

string $provider
string|null $service

Return Value

void

at line 68
void boot()

Boot the application's service providers.

Return Value

void

at line 76
void booting(mixed $callback)

Register a new boot listener.

Parameters

mixed $callback

Return Value

void

at line 84
void booted(mixed $callback)

Register a new "booted" listener.

Parameters

mixed $callback

Return Value

void

at line 91
string getCachedServicesPath()

Get the path to the cached services.php file.

Return Value

string