I have a page that list apartments depending on book dates like this


Everything is right, I am getting the date-from and date-get from the url and searching the database with those values. The problem is when I paginate and I click to go to another page the url changes to.


and get an error Value must be provided

The correct url must be


I am using paginate at the controller and $searchResult->links(); to generate the links

What can I do pass the date values from page to page so the pagination works?


Это было полезно?


If you want to tack on existing query string data, use this:

    'date-from' => Input::get('date-from'),
    'date-to'   => Input::get('date-to'),

Read the docs: Appending To Pagination Links.

You can shorten that a little:

$searchResult->appends( Input::only('data-from', 'date-to') );

which ends up being the same thing.

Другие советы

you can do this using the 'appends' feature. There are examples in the documentation: http://laravel.com/docs/pagination

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top