4 years ago

Laravel pagination: Change page parameter name

Posted 4 years ago by SergioGregorutti

Hi all,

I want to make a simple change on the Laravel pagination.

By default I get a "?page=x" URI but I need this: "?pag=x".

How can I make this change? I read the documentation and I found this:

Customizing The Paginator URI

The setPath method allows you to customize the URI used by the paginator when generating links. For example, if you want the paginator to generate links like, you should pass custom/url to the setPath method:

Route::get('users', function () {
    $users = App\User::paginate(15);



But it is no so clear for me.

Can someone help me?

Thanks in advance!

Please sign in or create an account to participate in this conversation.