class EnvironmentDetector (View source)

Methods

string
detect(Closure $callback, array|null $consoleArgs = null)

Detect the application's current environment.

string
detectWebEnvironment(Closure $callback)

Set the application environment for a web request.

string
detectConsoleEnvironment(Closure $callback, array $args)

Set the application environment from command-line arguments.

string|null
getEnvironmentArgument(array $args)

Get the environment argument from the console.

Details

string detect(Closure $callback, array|null $consoleArgs = null)

Detect the application's current environment.

Parameters

Closure $callback
array|null $consoleArgs

Return Value

string

protected string detectWebEnvironment(Closure $callback)

Set the application environment for a web request.

Parameters

Closure $callback

Return Value

string

protected string detectConsoleEnvironment(Closure $callback, array $args)

Set the application environment from command-line arguments.

Parameters

Closure $callback
array $args

Return Value

string

protected string|null getEnvironmentArgument(array $args)

Get the environment argument from the console.

Parameters

array $args

Return Value

string|null