From a36906ab8a141f1f497a0667196935e41970ae51 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Nov 2018 21:42:53 -0600 Subject: [PATCH] add env override for running in console --- src/Illuminate/Foundation/Application.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 4b2f54d170af..5b7299251e19 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -515,7 +515,10 @@ public function detectEnvironment(Closure $callback) */ public function runningInConsole() { - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; + return env( + 'LARAVEL_RUNNING_IN_CONSOLE', + php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg' + ); } /**