/** * Show the form for editing the settings. * * @param FormBuilder $formBuilder * @return Response */ public function getSettings(FormBuilder $formBuilder) { $setting = Setting::firstOrFail(); $form = $formBuilder->create('App\\Forms\\SettingsForm', ['method' => 'PATCH', 'url' => route('admin.setting.update', ['id' => $setting->id]), 'model' => $setting]); return view('admin.settings.index', compact('form', 'setting')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $setting = Setting::firstOrFail(); return View('admin.settings.setting')->with('setting', $setting); }
/** * Set settings and language * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { Config::set(['settings' => Setting::firstOrFail()]); return $next($request); }
/** * Show the form for editing the settings. * * @return Response */ public function getSettings() { $setting = Setting::firstOrFail(); return $this->getForm($setting); }