From 08309d6b8298236665da5b6bdca9eb22678fe867 Mon Sep 17 00:00:00 2001 From: Mohit Panjwani Date: Mon, 11 Nov 2019 13:04:09 +0530 Subject: [PATCH] fix environment issue --- .../Controllers/EnvironmentController.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/EnvironmentController.php b/app/Http/Controllers/EnvironmentController.php index e26bb837..2ce919e9 100755 --- a/app/Http/Controllers/EnvironmentController.php +++ b/app/Http/Controllers/EnvironmentController.php @@ -35,23 +35,19 @@ class EnvironmentController extends Controller { $results = $this->EnvironmentManager->saveDatabaseVariables($request); - try { - if(array_key_exists("success", $results)) { - Artisan::call('config:clear'); - Artisan::call('migrate --seed'); - Artisan::call('migrate', ['--path' => 'vendor/laravel/passport/database/migrations']); + if(array_key_exists("success", $results)) { - \Storage::disk('local')->put('database_created', 'database_created'); + Artisan::call('config:clear'); + Artisan::call('migrate --seed'); + Artisan::call('migrate', ['--path' => 'vendor/laravel/passport/database/migrations']); - Setting::setSetting('profile_complete', 3); - } - return response()->json($results); - } catch (Exception $e) { - return response()->json([ - 'error' => 'migrate_failed' - ]); + \Storage::disk('local')->put('database_created', 'database_created'); + + Setting::setSetting('profile_complete', 3); } + + return response()->json($results); } /**