コード例 #1
0
ファイル: ThemesController.php プロジェクト: yajra/cms-themes
 /**
  * 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();
 }
コード例 #2
0
 /**
  * Remove configuration by key.
  *
  * @param string $key
  * @return Configuration
  */
 protected function removeByKey($key)
 {
     return Configuration::where('key', $key)->delete();
 }