diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 5b7299251e19..f2e832c3cbae 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -515,10 +515,11 @@ public function detectEnvironment(Closure $callback) */ public function runningInConsole() { - return env( - 'LARAVEL_RUNNING_IN_CONSOLE', - php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg' - ); + if (isset($_ENV['APP_RUNNING_IN_CONSOLE'])) { + return $_ENV['APP_RUNNING_IN_CONSOLE'] === 'true'; + } + + return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; } /**