K
K
Konstantin B.2015-12-16 09:25:47
Laravel
Konstantin B., 2015-12-16 09:25:47

Full url of current page when paginated in Laravel 5?

Is it possible by means of Lara without writing your crutches to display page links with all the parameters included in the url of the query?
That is, now if there is no parameter in the url address, then it is not in the link to the next page.
For example, if the site address is site.ru/?foo=bar&page=2
Then the links were
site.ru/?foo=bar&page=1
site.ru/?foo=bar&page=2 Etc. Not
site.ru/?page
=2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2015-12-16
@Denormalization

You can't use standard tools.
But the paginator has an appends method that accepts an array that will be used as a query string.
laravel.com/docs/5.1/pagination
Section Appending To Pagination Links

S
Scronheim, 2017-01-19
@scronheim

{{ $users->appends($_REQUEST)->links }}
I did this))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question