/** * Execute the console command. * * @return mixed */ public function handle() { try { if ($key = $this->argument('key')) { $value = Setting::get($key); if (Str::isNullOrEmptyString($value)) { $this->comment("No setting found or empty setting."); } else { if (is_array($value)) { $value = Arr::dot($value); foreach ($value as $key2 => $value2) { $this->line("{$key}.{$key2}={$value2}"); } } else { $this->line($key . "=" . $value); } } } else { $this->error("Missing 'key' argument."); } } catch (\Exception $ex) { $this->error("Exception: " . $ex->getMessage()); $this->error("Stack trace: " . $ex->getTraceAsString()); } }
public function clear() { $settings = Setting::all(); $settings = Arr::dot($settings); foreach ($settings as $key => $value) { $this->forget($key); } $this->save(); }
/** * Execute the console command. * * @return mixed */ public function handle() { try { $settings = Setting::all(); $settings = Arr::dot($settings); foreach ($settings as $key => $value) { $this->line("{$key}={$value}"); } } catch (\Exception $ex) { $this->error("Exception: " . $ex->getMessage()); $this->error("Stack trace: " . $ex->getTraceAsString()); } }
/** * @return \Illuminate\View\View */ public function profile() { $user = Auth::user(); Audit::log(Auth::user()->id, trans('general.audit-log.category-profile'), trans('general.audit-log.msg-profile-show', ['username' => $user->username])); $page_title = trans('general.page.profile.title'); $page_description = trans('general.page.profile.description', ['full_name' => $user->full_name]); $readOnlyIfLDAP = 'ldap' == $user->auth_type ? 'readonly' : ''; $perms = $this->perm->pushCriteria(new PermissionsByNamesAscending())->all(); $themes = \Theme::getList(); $themes = Arr::indexToAssoc($themes, true); $theme = $user->settings()->get('theme'); $time_zones = \DateTimeZone::listIdentifiers(); $time_zone = $user->settings()->get('time_zone'); $tzKey = array_search($time_zone, $time_zones); $time_format = $user->settings()->get('time_format'); $locales = Setting::get('app.supportedLocales'); $locale = $user->settings()->get('locale'); return view('user.profile', compact('user', 'perms', 'themes', 'theme', 'time_zones', 'tzKey', 'time_format', 'locale', 'locales', 'readOnlyIfLDAP', 'page_title', 'page_description')); }