FEATURE: add page ordering
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user