Good day, i have a query which is being paginated. But i want to be able to paginate it via a form input.
How should I modify my code, to be able to request a specific page (like page 2/3/4) from the paginator?
This is laravel 4.2! not 5.
DB::table('recr_vehicles')
->leftJoin('users', 'users.id', '=', 'recr_vehicles.owner_id')
->whereBetween('recr_vehicles.latitude', array(Input::get('swlat'), Input::get('nelat')))
->whereBetween('recr_vehicles.longitude', array(Input::get('swlng'), Input::get('nelng')))
->select('recr_vehicles.*','users.email')
->paginate(15);
return View::make('search.results',['result_rvs'=>$result_rvs,'count_rvs'=>$count_rvs]);
Solved.
The answer was to add before everything. And then post the page. Thanks to madmoose from the laravel irc chat App::make('paginator')->setCurrentPage(Input::get('page'));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community