public function getOrder(Request $request) { $getSearch = Session::get('catgorysearch'); $statusSearch = Session::get('statussearchc'); $approveornot = Session::get('approveornotc'); $orderbrBY = $request->input('name'); $orderDe = $request->input('sens'); Session::set('catorderby', $orderbrBY); Session::set('catorderde', $orderDe); if (!empty($approveornot)) { if (!empty($getSearch)) { $categorylist = $this->category_gestion->getsearchdata(5, $statusSearch, $getSearch, $orderbrBY, $orderDe); } else { $categorylist = $this->category_gestion->getsearchdata(5, $statusSearch, '', $orderbrBY, $orderDe); } } else { if (!empty($getSearch)) { $categorylist = $this->category_gestion->getstatsearchdata(5, '', $getSearch, $orderbrBY, $orderDe); } else { $categorylist = $this->category_gestion->index(5, $orderbrBY, $orderDe); } } $links = str_replace('/order/', '', $categorylist->render()); return response()->json(['view' => view('admin.category.table', compact('categorylist'))->render(), 'links' => $links]); }