Documentation

Application extends Container

Describes the interface of a container that exposes methods to read its entries.

Table of Contents

afterResolving()  : void
Register a new after resolving callback.
alias()  : void
Alias a type to a different name.
basePath()  : string
Get the base path of the Laravel installation.
bind()  : void
Register a binding with the container.
bindIf()  : void
Register a binding if it hasn't already been registered.
boot()  : void
Boot the application's service providers.
booted()  : void
Register a new "booted" listener.
booting()  : void
Register a new boot listener.
bound()  : bool
Determine if the given abstract type has been bound.
call()  : mixed
Call the given Closure / class@method and inject its dependencies.
environment()  : string
Get or check the current application environment.
extend()  : void
"Extend" an abstract type in the container.
factory()  : Closure
Get a closure to resolve the given type from the container.
get()  : mixed
Finds an entry of the container by its identifier and returns it.
getCachedPackagesPath()  : string
Get the path to the cached packages.php file.
getCachedServicesPath()  : string
Get the path to the cached services.php file.
has()  : bool
Returns true if the container can return an entry for the given identifier.
instance()  : mixed
Register an existing instance as shared in the container.
isDownForMaintenance()  : bool
Determine if the application is currently down for maintenance.
make()  : mixed
Resolve the given type from the container.
register()  : ServiceProvider
Register a service provider with the application.
registerConfiguredProviders()  : void
Register all of the configured providers.
registerDeferredProvider()  : void
Register a deferred provider and service.
resolved()  : bool
Determine if the given abstract type has been resolved.
resolving()  : void
Register a new resolving callback.
runningInConsole()  : bool
Determine if we are running in the console.
singleton()  : void
Register a shared binding in the container.
tag()  : void
Assign a set of tags to a given binding.
tagged()  : array<string|int, mixed>
Resolve all of the bindings for a given tag.
version()  : string
Get the version number of the application.
when()  : ContextualBindingBuilder
Define a contextual binding.

Methods

afterResolving()

Register a new after resolving callback.

public afterResolving(Closure|string $abstract[, Closure|null $callback = null ]) : void
Parameters
$abstract : Closure|string
$callback : Closure|null = null
Return values
void

alias()

Alias a type to a different name.

public alias(string $abstract, string $alias) : void
Parameters
$abstract : string
$alias : string
Return values
void

basePath()

Get the base path of the Laravel installation.

public basePath() : string
Return values
string

bind()

Register a binding with the container.

public bind(string $abstract[, Closure|string|null $concrete = null ][, bool $shared = false ]) : void
Parameters
$abstract : string
$concrete : Closure|string|null = null
$shared : bool = false
Return values
void

bindIf()

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

public bindIf(string $abstract[, Closure|string|null $concrete = null ][, bool $shared = false ]) : void
Parameters
$abstract : string
$concrete : Closure|string|null = null
$shared : bool = false
Return values
void

boot()

Boot the application's service providers.

public boot() : void
Return values
void

booted()

Register a new "booted" listener.

public booted(mixed $callback) : void
Parameters
$callback : mixed
Return values
void

booting()

Register a new boot listener.

public booting(mixed $callback) : void
Parameters
$callback : mixed
Return values
void

bound()

Determine if the given abstract type has been bound.

public bound(string $abstract) : bool
Parameters
$abstract : string
Return values
bool

call()

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

public call(callable|string $callback[, array<string|int, mixed> $parameters = [] ][, string|null $defaultMethod = null ]) : mixed
Parameters
$callback : callable|string
$parameters : array<string|int, mixed> = []
$defaultMethod : string|null = null
Return values
mixed

environment()

Get or check the current application environment.

public environment() : string
Return values
string

extend()

"Extend" an abstract type in the container.

public extend(string $abstract, Closure $closure) : void
Parameters
$abstract : string
$closure : Closure
Tags
throws
InvalidArgumentException
Return values
void

factory()

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

public factory(string $abstract) : Closure
Parameters
$abstract : string
Return values
Closure

getCachedPackagesPath()

Get the path to the cached packages.php file.

public getCachedPackagesPath() : string
Return values
string

getCachedServicesPath()

Get the path to the cached services.php file.

public getCachedServicesPath() : string
Return values
string

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters
$id : string

Identifier of the entry to look for.

Return values
bool

instance()

Register an existing instance as shared in the container.

public instance(string $abstract, mixed $instance) : mixed
Parameters
$abstract : string
$instance : mixed
Return values
mixed

isDownForMaintenance()

Determine if the application is currently down for maintenance.

public isDownForMaintenance() : bool
Return values
bool

make()

Resolve the given type from the container.

public make(string $abstract[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
$abstract : string
$parameters : array<string|int, mixed> = []
Return values
mixed

registerConfiguredProviders()

Register all of the configured providers.

public registerConfiguredProviders() : void
Return values
void

registerDeferredProvider()

Register a deferred provider and service.

public registerDeferredProvider(string $provider[, string|null $service = null ]) : void
Parameters
$provider : string
$service : string|null = null
Return values
void

resolved()

Determine if the given abstract type has been resolved.

public resolved(string $abstract) : bool
Parameters
$abstract : string
Return values
bool

resolving()

Register a new resolving callback.

public resolving(Closure|string $abstract[, Closure|null $callback = null ]) : void
Parameters
$abstract : Closure|string
$callback : Closure|null = null
Return values
void

runningInConsole()

Determine if we are running in the console.

public runningInConsole() : bool
Return values
bool

singleton()

Register a shared binding in the container.

public singleton(string $abstract[, Closure|string|null $concrete = null ]) : void
Parameters
$abstract : string
$concrete : Closure|string|null = null
Return values
void

tag()

Assign a set of tags to a given binding.

public tag(array<string|int, mixed>|string $abstracts, array<string|int, mixed>|mixed ...$tags) : void
Parameters
$abstracts : array<string|int, mixed>|string
$tags : array<string|int, mixed>|mixed
Return values
void

tagged()

Resolve all of the bindings for a given tag.

public tagged(string $tag) : array<string|int, mixed>
Parameters
$tag : string
Return values
array<string|int, mixed>

version()

Get the version number of the application.

public version() : string
Return values
string

Search results