title = $title; $section->layout = $layout; $section->order = $order; $section->save(); return $section; } public function update($id, $title, $layout, $order) { $section = Section::find($id); if ($section) { $section->title = $title; $section->layout = $layout; $section->order = $order; $section->update(); return $section; } return false; } public function destroy($id) { SectionItem::where('section_id', $id)->delete(); SectionCategory::where('section_id', $id)->delete(); return Section::destroy($id); } }