Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain querystring values during pagination #69

Open
mulongokato opened this issue Sep 24, 2022 · 4 comments
Open

Retain querystring values during pagination #69

mulongokato opened this issue Sep 24, 2022 · 4 comments

Comments

@mulongokato
Copy link

Hello, I love this package so much, it does not play nice with pagination options like withQueryString()

@mulongokato
Copy link
Author

This worked as a temporary solution

$data = new \Illuminate\Pagination\LengthAwarePaginator(
$data->getCollection(),
$data->total(),
$data->perPage(),
$data->currentPage(), [
'path' => request()->url(),
'query' => $request->query()
]
);

where $data is the result from Search::new()->add(...

@jandermannderkann
Copy link

I Think this is the same Issue as this one posted to the Laravel-Ide-Helper Project.

barryvdh/laravel-ide-helper#1144

@pascalbaljet
Copy link
Contributor

I don't understand the problem. Could you give an example so I can reproduce the problem?

@lucacastelnuovo
Copy link

This solution worked for me:

$results->appends($request->query());

Here is a link to the documentation: https://laravel.com/docs/9.x/pagination#appending-query-string-values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants