From f9bafeb91e64d28b32dc5be7f2085fea89568919 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Thu, 6 Oct 2016 16:58:02 +0100 Subject: [PATCH] refs #5: Version number is now saved to the configuration table. Database sessions are enabled once the database is up and running --- app/Http/Controllers/InstallController.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/InstallController.php b/app/Http/Controllers/InstallController.php index 09cc749..22c1432 100644 --- a/app/Http/Controllers/InstallController.php +++ b/app/Http/Controllers/InstallController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Configuration; +use App\Facade\UserConfig; use App\Helpers\MiscHelper; use App\Http\Requests\StoreUserRequest; use App\User; @@ -155,16 +156,12 @@ class InstallController extends Controller Artisan::call('cache:clear'); Artisan::call('migrate', ['--force' => true]); - $result = Configuration::where('key', 'install_completed')->first(); - if (is_null($result)) - { - $result = new Configuration(); - $result->key = 'install_completed'; - $result->value = true; - $result->save(); - } + $versionNumber = UserConfig::getOrCreateModel('app_version'); + $versionNumber->value = config('app.version'); + $versionNumber->save(); // Now the database is up-to-date, we can enable database sessions + MiscHelper::setEnvironmentSetting('SESSION_DRIVER', 'database'); $request->session()->set('install_stage', 3); return redirect(route('install.administrator'));