FEATURE: add page ordering

This commit is contained in:
Michal Kváček
2017-09-13 14:02:07 +02:00
parent d90ca08ba6
commit 3fdae2669b
13 changed files with 293 additions and 215 deletions
@@ -117,4 +117,24 @@ class EditContent extends Controller
->route('content.overview')
->with('success', trans('admin/contents.successfullyEdited'));
}
public function order() {
$pages = $this->content->getOverview()->get();
return view('admin.content.order', compact('pages'));
}
public function setOrder(Request $request) {
$data = $request->get('page');
foreach ($data as $id => $order) {
Content::where('id', $id)->update(['order' => $order]);
}
// something was changed, inform user
return redirect()
->route('content.overview')
->with('success', trans('admin/contents.orderSuccessfullySet'));
}
}