2

I have a table users where I am getting user specefic data in table

abc.com?country=india&state=haryana

and I am using Laravel pagination

($user->links())

when I move to next page previous parameters are removing from the URL. The url only remaining with

abc.com?page=2

How to resolve this issue?

Vinay
  • 21
  • 4
  • Does this answer your question? [Laravel Pagination links not including other GET parameters](https://stackoverflow.com/questions/17159273/laravel-pagination-links-not-including-other-get-parameters) – medilies Apr 02 '22 at 12:24

1 Answers1

1

You can call withQueryString method on the paginator instance.

$users->withQueryString()->links()

That method is only available as of Laravel 7.

ThS
  • 4,597
  • 2
  • 15
  • 27