Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

toby's avatar
Level 31

[L5.*] Pagination: Change URL query name "page" globally

Hi,

almost a year ago, I asked, if it's possible to globally change the name for the page query attribute if you enable pagination: Instead of having a url like tickets?page=23 I wanted to translate this to tickets?seite=23. Therefore, I created a lil' helper function to do so.

I also use the following snippet inside my routes/web.php file to rename the routes from tickets/new to tickets/neu and tickets/23/edit to tickets/23/bearbeiten:

// routes/web.php

Route::resourceVerbs([
    'create' => 'neu',
    'edit' => 'bearbeiten',
]);

Route::resource('tickets', 'TicketController');

I wonder if there is an alternative solution to the ?page=-to-?seite=-problem?

Thanks in advance

0 likes
2 replies
Cinek's avatar

Third parameter of paginate method do this

->paginate($limit,['*'],'seite')
toby's avatar
Level 31

Thanks for the suggestion, but I'm looking for something like a global setting; this is why I created the pagination()-helper (see first post) in the first place.

Something like a single place where I can define the query name. (Image to rename from seite to something different... Each controller needs to be updated...)

Please or to participate in this conversation.