This commit is contained in:
denisdulici
2018-06-09 15:37:28 +03:00
parent 270e811150
commit 7fa629e8b5
4 changed files with 36 additions and 12 deletions

View File

@ -139,12 +139,9 @@ class Settings extends Controller
}
}
// Change default locale if only 1 company
if (($key == 'default_locale') && ($companies == 1)) {
// Update .env file
Installer::updateEnv([
'APP_LOCALE' => $value
]);
// If only 1 company
if ($companies == 1) {
$this->oneCompany($key, $value);
}
setting()->set('general.' . $key, $value);
@ -159,4 +156,22 @@ class Settings extends Controller
return redirect('settings/settings');
}
protected function oneCompany($key, $value)
{
switch ($key) {
case 'default_locale':
// Change default locale
Installer::updateEnv([
'APP_LOCALE' => $value
]);
break;
case 'session_handler':
// Change session handler
Installer::updateEnv([
'SESSION_DRIVER' => $value
]);
break;
}
}
}