/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(SettingsRequest $request, $id) { $setting = Setting::findOrFail($id); $setting->facebook = $request->input('facebook'); $setting->twitter = $request->input('twitter'); $setting->instagram = $request->input('instagram'); $setting->wishlist = $request->input('wishlist'); $setting->about = $request->input('about'); $setting->contact = $request->input('contact'); $setting->save(); return redirect()->back(); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $settings = Setting::first(); view()->share('settings', $settings); }