/** * Show the application dashboard to the user. * * @return Response */ public function getIndex() { $sort = Request::input('sort', 'DESC'); $order = Request::input('order', 'post_id'); $rows = Request::input('rows', '10'); list($arr_search, $module) = $this->buildSearch(Post::getInfoTable()); $data = array(); $page = DB::table('post')->Where(function ($query) use($arr_search) { foreach ($arr_search as $s) { $query->where($s[0], $s[1], $s[2]); } })->OrderBy($order, $sort)->paginate($rows); $data['module'] = $module; $data['items'] = $page; $data['url_page'] = $page->render(); $data['sort'] = $sort; $data['order'] = $order; $data['rows'] = $rows; $data['total'] = $page->total(); $data['count'] = $page->count() . $page->currentPage(); return view("layout.admin.Post.index", $data)->with('page', $this->page); }