fix database connection issue

This commit is contained in:
raishvaria
2019-12-04 13:38:51 +05:30
parent b388e7a237
commit edc0e115e4
2 changed files with 12 additions and 18 deletions

View File

@ -49,20 +49,22 @@ class EnvironmentManager
'DB_PASSWORD='.$request->database_password."\n\n";
try {
if ($this->checkDatabaseConnection($request)) {
if(\Schema::hasTable('users') ) {
return [
'error' => 'database_should_be_empty'
];
}
$this->checkDatabaseConnection($request);
if(\Schema::hasTable('users') ) {
return [
'error' => 'database_should_be_empty'
];
}
} catch (Exception $e) {
return [
'error' => $e->getMessage()
];
}
try {
file_put_contents($this->envPath, str_replace(
@ -120,8 +122,6 @@ class EnvironmentManager
);
}
} catch (Exception $e) {
return [
'error' => 'mail_variables_save_error'
@ -318,12 +318,6 @@ class EnvironmentManager
],
]);
try {
DB::connection()->getPdo();
return true;
} catch (Exception $e) {
return $e;
}
return DB::connection()->getPdo();
}
}