/** * Display a listing of the resource. * * @return Response */ public function index(Request $request, ApiRepository $apirepo) { if ($request->has('page')) { //so you can search like this http://localhost/ewa2015/public/candidate?page=1&gender=F&party=1&blahblah=foobar $faqList = $apirepo->getFaqList($request->input('page')); } else { //if request have no parameter here u go with normal pagination list $faqList = $apirepo->getFaqList(); } dd($faqList); return view('faq.all', compact('faqList')); }