From d06e17dfdce82b7d61a80bd8364cfbe64a6da63e Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Mon, 18 Mar 2019 16:44:38 +0800 Subject: [PATCH] Strip `FIRST_RUN` if database ok --- app/Http/Controllers/SetupController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 9f8e37f1..e316ee6f 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -21,6 +21,11 @@ class SetupController extends Controller if ($request->isMethod('get')) { try { DB::getPdo(); + + $content = File::get('..'.DIRECTORY_SEPARATOR.'.env'); + $content = str_replace('FIRST_RUN = true', '', $content); + File::put('..'.DIRECTORY_SEPARATOR.'.env', $content); + return redirect('setup/info'); } catch (\Exception $e) { return view('setup.wizard.database');