class ApplicationBuilder (View source)

Properties

protected array $pendingProviders

The service provider that are marked for registration.

protected array $pageMiddleware

The Folio / page middleware that have been defined by the user.

Methods

__construct(Application $app)

Create a new application builder instance.

$this
withKernels()

Register the standard kernel classes for the application.

$this
withProviders(array $providers = [], bool $withBootstrapProviders = true)

Register additional service providers.

$this
withEvents(array $discover = [])

Register the core event service provider for the application.

$this
withBroadcasting(string $channels)

Register the braodcasting services for the application.

$this
withRouting(Closure|null $using = null, string|null $web = null, string|null $api = null, string|null $commands = null, string|null $channels = null, string|null $pages = null, string|null $health = null, string $apiPrefix = 'api', callable|null $then = null)

Register the routing services for the application.

buildRoutingCallback(string|null $web, string|null $api, string|null $pages, string|null $health, string $apiPrefix, callable|null $then)

Create the routing callback for the application.

$this
withMiddleware(callable|null $callback = null)

Register the global middleware, middleware groups, and middleware aliases for the application.

$this
withCommands(array $commands = [])

Register additional Artisan commands with the application.

$this
withCommandRouting(array $paths)

Register additional Artisan route paths.

$this
withExceptions(callable|null $using = null)

Register and configure the application's exception handler.

$this
withBindings(array $bindings)

Register an array of container bindings to be bound when the application is booting.

$this
withSingletons(array $singletons)

Register an array of singleton container bindings to be bound when the application is booting.

$this
registered(callable $callback)

Register a callback to be invoked when the application's service providers are registered.

$this
booting(callable $callback)

Register a callback to be invoked when the application is "booting".

$this
booted(callable $callback)

Register a callback to be invoked when the application is "booted".

create()

Get the application instance.

Details

__construct(Application $app)

Create a new application builder instance.

Parameters

Application $app

$this withKernels()

Register the standard kernel classes for the application.

Return Value

$this

$this withProviders(array $providers = [], bool $withBootstrapProviders = true)

Register additional service providers.

Parameters

array $providers
bool $withBootstrapProviders

Return Value

$this

$this withEvents(array $discover = [])

Register the core event service provider for the application.

Parameters

array $discover

Return Value

$this

$this withBroadcasting(string $channels)

Register the braodcasting services for the application.

Parameters

string $channels

Return Value

$this

$this withRouting(Closure|null $using = null, string|null $web = null, string|null $api = null, string|null $commands = null, string|null $channels = null, string|null $pages = null, string|null $health = null, string $apiPrefix = 'api', callable|null $then = null)

Register the routing services for the application.

Parameters

Closure|null $using
string|null $web
string|null $api
string|null $commands
string|null $channels
string|null $pages
string|null $health
string $apiPrefix
callable|null $then

Return Value

$this

protected Closure buildRoutingCallback(string|null $web, string|null $api, string|null $pages, string|null $health, string $apiPrefix, callable|null $then)

Create the routing callback for the application.

Parameters

string|null $web
string|null $api
string|null $pages
string|null $health
string $apiPrefix
callable|null $then

Return Value

Closure

$this withMiddleware(callable|null $callback = null)

Register the global middleware, middleware groups, and middleware aliases for the application.

Parameters

callable|null $callback

Return Value

$this

$this withCommands(array $commands = [])

Register additional Artisan commands with the application.

Parameters

array $commands

Return Value

$this

protected $this withCommandRouting(array $paths)

Register additional Artisan route paths.

Parameters

array $paths

Return Value

$this

$this withExceptions(callable|null $using = null)

Register and configure the application's exception handler.

Parameters

callable|null $using

Return Value

$this

$this withBindings(array $bindings)

Register an array of container bindings to be bound when the application is booting.

Parameters

array $bindings

Return Value

$this

$this withSingletons(array $singletons)

Register an array of singleton container bindings to be bound when the application is booting.

Parameters

array $singletons

Return Value

$this

$this registered(callable $callback)

Register a callback to be invoked when the application's service providers are registered.

Parameters

callable $callback

Return Value

$this

$this booting(callable $callback)

Register a callback to be invoked when the application is "booting".

Parameters

callable $callback

Return Value

$this

$this booted(callable $callback)

Register a callback to be invoked when the application is "booted".

Parameters

callable $callback

Return Value

$this

Application create()

Get the application instance.

Return Value

Application