I have a request with this URL
expenses?startDate=2019-05-09&endDate=2019-05-15
now what I wanted is to append the startDate=2019-05-09&endDate=2019-05-15
to the new request URL so that I can go to the second page with the current result
expenses?pages=2&startDate=2019-05-09&endDate=2019-05-15
I tried
$builder->latest()->paginate(10)->appends(request()->query());
but when i click to my pagination it is not appending thus I get only
expenses?pages=2
any idea how can I achieve this?
PS. im not using blade
I think you are little bit confused.
request()->query()
will be available only in page 1 but after it will be null.So you are getting only the
page
in get method.In your blade try this: