/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(Request $request, $id) { $setting = Setting::find($id); $setting->name = $request->name; $setting->save(); return redirect('settings/' . $setting->_id); }
public function compose(View $view) { $setting = Setting::orderBy('created_at', 'DESC')->first(); if (!is_null($setting)) { $view->with('app_title', $setting->name); } else { $view->with('app_title', 'Default App Title'); } }