/** * Reorder sections by theirid. * * @param $sections * @return mixed */ public function reorderSections($sections) { foreach ($sections as $key => $section) { $section = Section::findOrFail($section)->update(['order' => $key]); } return 'success'; }