Skip to content

ApplicationBuilder

  • Full name: \Codefy\Framework\Configuration\ApplicationBuilder
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Properties

app

protected \Codefy\Framework\Application $app

Methods

__construct

public __construct(\Codefy\Framework\Application $app): mixed

Parameters:

Parameter Type Description
$app \Codefy\Framework\Application

withKernels

Register the kernels for the application.

public withKernels(): $this

withProviders

Register additional service providers.

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

Parameters:

Parameter Type Description
$providers array
$withBootstrapProviders bool

Throws:


withSingletons

Register an array of singletons that are resource intensive or are not called often.

public withSingletons(array $singletons = []): $this

Parameters:

Parameter Type Description
$singletons array

withRouting

Register the routing services for the application.

public withRouting(callable|\Closure|null $using = null, array|string|null $web = null, array|null $class = null, array|string|null $api = null, string $apiPrefix = 'api', callable|null $then = null): $this

Parameters:

Parameter Type Description
$using callable|\Closure|null
$web array|string|null
$class array|null
$api array|string|null
$apiPrefix string
$then callable|null

Throws:


withEncryptedEnv

Set whether environment variables should be encrypted.

public withEncryptedEnv(bool $bool = false): $this

Parameters:

Parameter Type Description
$bool bool Default: false.

buildRoutingCallback

Create the routing callback for the application.

protected buildRoutingCallback(array|string|null $web = null, array|string|null $api = null, string $apiPrefix = 'api', callable|null $then = null): \Closure

Parameters:

Parameter Type Description
$web array|string|null
$api array|string|null
$apiPrefix string
$then callable|null

registered

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

public registered(callable $callback): $this

Parameters:

Parameter Type Description
$callback callable

booting

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

public booting(callable $callback): $this

Parameters:

Parameter Type Description
$callback callable

booted

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

public booted(callable $callback): $this

Parameters:

Parameter Type Description
$callback callable

return

Return the application instance.

public return(): \Codefy\Framework\Application


Automatically generated on 2025-10-13