/** * Display a listing of the resource. * * @param Illuminate\Http\Request $request * @return Response */ public function indexOrder(Request $request) { //$statut = $this->user_gestion->getStatut(); $posts = $this->cat_gestion->index(config("constants.LIMIT"), null, $request->name, $request->sort); $links = $posts->appends(['name' => $request->name, 'sort' => $request->sort]); if ($request->ajax()) { return response()->json(['view' => view('back.cat.table', compact('posts'))->render(), 'links' => $links->setPath('order')->render()]); } $order = (object) ['name' => $request->name, 'sort' => 'sort-' . $request->sort]; return view('back.cat.index', compact('posts', 'links', 'order')); }
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]); }