exists(storage_path('install.lock')); // If lock isn't existed, it means that BS isn't installed. // Database is unavailable at this time, so we should disable the loader. if (!$hasLock) { config(['translation-loader.translation_loaders' => []]); } if ($hasLock && !$request->is('setup*') && Comparator::greaterThan($version, option('version', $version))) { Artisan::call('update'); } if ($hasLock || $request->is('setup*')) { return $next($request); } return redirect('/setup'); } }