protected function detectConsoleEnvironment(Closure $callback, array $args): string
    {
        // First we will check if an environment argument was passed via console arguments
        // and if it was that automatically overrides as the environment. Otherwise, we
        // will check the environment as a "web" request like a typical HTTP request.
        $value = $this->getEnvironmentArgument($args);

        if ($value !== null) {
            $arr = \array_slice(\explode('=', $value), 1);

            return \reset($arr);
        }

        return $this->detectWebEnvironment($callback);
    }
protected function detectConsoleEnvironment(Closure $callback, array $args): string
    {
        // First we will check if an environment argument was passed via console arguments
        // and if it was that automatically overrides as the environment. Otherwise, we
        // will check the environment as a "web" request like a typical HTTP request.
        $value = $this->getEnvironmentArgument($args);

        if ($value !== null) {
            $arr = \array_slice(\explode('=', $value), 1);

            return \reset($arr);
        }

        return $this->detectWebEnvironment($callback);
    }
protected function detectConsoleEnvironment ( Closure $ callback , array $ args ) : string { // First we will check if an environment argument was passed via console arguments // and if it was that automatically overrides as the environment. Otherwise, we // will check the environment as a "web" request like a typical HTTP request. $ value = $ this -> getEnvironmentArgument ( $ args ) ; if ( $ value !== null ) { $ arr = \ array_slice ( \ explode ( '=' , $ value ) , 1 ) ; return \ reset ( $ arr ) ; } return $ this -> detectWebEnvironment ( $ callback ) ; }
Set the application environment from command-line arguments.

@param \Closure $callback
@param array    $args

@return string
Set the application environment from command - line arguments .