public function index() { $sidebars = Sidebar::paginate(25); $leftSidebars = Sidebar::where('position', 'LIKE', '%Left%')->paginate(25); $rightSidebars = Sidebar::where('position', 'LIKE', '%Right%')->paginate(25); return $this->getView()->shares('title', 'Manage Sidebars')->withLeftSidebars($leftSidebars)->withRightSidebars($rightSidebars)->withSidebars($sidebars); }
public function edit($id) { $page = Page::find($id); $revisions = DB::table('page_revisions')->where('pageID', $id)->get(); $pageblocks = DB::table('page_blocks')->where('pageID', $id)->get(); if ($page === null) { return Redirect::to('admin/pages')->withStatus('Page not found', 'danger'); } $layoutfiles = $this->getLayoutFiles(); $leftSidebars = Sidebar::where('position', 'LIKE', '%Left%')->get(); $rightSidebars = Sidebar::where('position', 'LIKE', '%Right%')->get(); return $this->getView()->shares('title', 'Edit Page')->withLayouts($layoutfiles)->withPage($page)->withLeftSidebars($leftSidebars)->withRightSidebars($rightSidebars)->withRevisions($revisions)->withPageBlocks($pageblocks); }