From 3cf5c646c67bb8ad32aa30d9642adb0e96fe6edd Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 22 Jul 2018 18:54:37 +0800 Subject: [PATCH] Refactor --- app/Providers/BootServiceProvider.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Providers/BootServiceProvider.php b/app/Providers/BootServiceProvider.php index 35679da9..0f5027b5 100644 --- a/app/Providers/BootServiceProvider.php +++ b/app/Providers/BootServiceProvider.php @@ -19,12 +19,17 @@ class BootServiceProvider extends ServiceProvider // Detect current locale $this->app->call('App\Http\Middleware\DetectLanguagePrefer@detect'); - // Skip the installation check when setup or under CLI - if (! $request->is('setup*') && PHP_SAPI != "cli") { - $this->checkInstallation(); + // Skip the installation check when in setup or under CLI + if ($request->is('setup*') || $this->app->runningInConsole()) { + return; } + + $this->checkInstallation(); // @codeCoverageIgnore } + /** + * @codeCoverageIgnore + */ protected function checkInstallation() { // Redirect to setup wizard