EnvironmentDetector
class EnvironmentDetector (View source)
Methods
string
string
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.
protected string
detectWebEnvironment(Closure $callback)
Set the application environment for a web request.
protected string
detectConsoleEnvironment(Closure $callback, array $args)
Set the application environment from command-line arguments.
protected string|null
getEnvironmentArgument(array $args)
Get the environment argument from the console.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.