I am trying to implement pagination with Laravel and jQuery ajax.
I need to send page number to a post controller and get the results for that specific page.
So my question is. Is there a way to get a specific page from the Paginator in Laravel, something like $model->page(3)
for getting the third page from the paginated data as an array, so i can serialize it as JSON and send back as a response?
UPDATE:
Thanks to the good people on Laravel's irc channel I found the answer. So i will write here as help for others. The magic is this:
Input::merge(array("page" => $page_number))
you actually make Laravel's Paginator thinks that a "page" parameter is passed in the action. Neat huh :)