public function load($envName) { $cnt = 0; $settingsFileName = ".settings-" . $envName; $settingsPath = self::$app->environmentPath(); $settingsFullFileName = $settingsPath . '/' . $settingsFileName; if (\File::exists($settingsFullFileName)) { $cnt = SettingDotEnv::load($settingsPath, $settingsFileName); } else { throw new FileNotFoundException($settingsFullFileName); } return $cnt; }
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'); }