Laravel Pagination with URL parameters


If you are planning to use pagination with existing parameter from URL, this post might be helpful for you.

You need to use ->appends() function.

Here is the example-

return view('foldername/filename', [
    'posts' => $posts->appends($request->input('passYourUrlValue'))
]);

Hope it will work.