public function load() { $envName = env('APP_ENV', 'production'); $settingsFileName = ".settings-" . $envName; $settingsPath = $this->app->environmentPath(); if (\File::exists($settingsPath . '/' . $settingsFileName)) { $cnt = SettingDotEnv::load($settingsPath, $settingsFileName); if (0 == $cnt) { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.no-settings-loaded', ['env' => $envName]), FlashLevel::WARNING); } else { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.settings-loaded', ['number' => $cnt, 'env' => $envName]), FlashLevel::SUCCESS); } } else { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.settings-file-not-found', ['env' => $envName]), FlashLevel::ERROR); } return redirect('/admin/settings'); }
public function load() { $envName = env('APP_ENV', 'production'); try { $cnt = Setting::load($envName); if (0 == $cnt) { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.no-settings-loaded', ['env' => $envName]), FlashLevel::WARNING); } else { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.settings-loaded', ['number' => $cnt, 'env' => $envName]), FlashLevel::SUCCESS); } } catch (FileNotFoundException $fnfx) { Utils::flashAndAudit(trans('admin/settings/general.audit-log.category'), trans('admin/settings/general.status.settings-file-not-found', ['env' => $envName]), FlashLevel::ERROR); } return redirect('/admin/settings'); }