/** * Store new default theme. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function store(Request $request) { $this->validate($request, ['theme' => 'required']); /** @var Configuration $config */ $config = Configuration::query()->firstOrCreate(['key' => 'themes.frontend']); $config->value = $request->get('theme'); $config->save(); flash()->success(trans('themes::theme.success', ['theme' => $request->get('theme')])); return back(); }
/** * Remove configuration by key. * * @param string $key * @return Configuration */ protected function removeByKey($key) { return Configuration::where('key', $key)->delete(); }