/** * 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->blog_gestion->index(10, $statut == 'admin' ? null : $request->user()->id, $request->input('name'), $request->input('sens')); $links = str_replace('/?', '?', $posts->render()); return response()->json(['view' => view('back.blog.table', compact('statut', 'posts'))->render(), 'links' => $links]); }
/** * 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->blog_gestion->index(10, $statut == 'admin' ? null : $request->user()->id, $request->name, $request->sens); $links = $posts->appends(['name' => $request->name, 'sens' => $request->sens]); if ($request->ajax()) { return response()->json(['view' => view('back.blog.table', compact('statut', 'posts'))->render(), 'links' => $links->setPath('order')->render()]); } $links->setPath('')->render(); $order = (object) ['name' => $request->name, 'sens' => 'sort-' . $request->sens]; return view('back.blog.index', compact('posts', 'links', 'order')); }
/** * Display a listing of the resource. * * @param Illuminate\Http\Request $request * @return Response */ public function indexOrder(Request $request) { /* $statut = $this->user_control->getStatut(); */ $posts = $this->blog_control->index(10, null, $request->name, $request->sens); $category = $this->category_control->index(10, $request->name, $request->sens); $links = $posts->appends(['name' => $request->name, 'sens' => $request->sens]); if ($request->ajax()) { return response()->json(['view' => view('kadmin.category.table', compact('statut', 'category'))->render(), 'links' => $links->setPath('order')->render()]); } $links->setPath('')->render(); $order = (object) ['name' => $request->name, 'sens' => 'sort-' . $request->sens]; return view('kadmin.category.index', compact('category', 'links', 'order')); }