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