APP_INSTALLED should be checked in order to decide that app is installed or not

This commit is contained in:
Sevan Nerse 2019-11-17 10:54:30 +03:00
parent b4eb9337d9
commit ea92c9674e

View File

@ -3,7 +3,6 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Closure; use Closure;
use File;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class RedirectIfNotInstalled class RedirectIfNotInstalled
@ -17,12 +16,12 @@ class RedirectIfNotInstalled
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
// Check if .env file exists // Check application is installed or not
if (File::exists(base_path('.env'))) { if (env('APP_INSTALLED', false) == true) {
return $next($request); return $next($request);
} }
// Already in the wizard // Already in the installation wizard
if (Str::startsWith($request->getPathInfo(), '/install')) { if (Str::startsWith($request->getPathInfo(), '/install')) {
return $next($request); return $next($request);
} }