lavelforum's avatar

Pagination appends and route

When we want to keep the parameters within the pagination, we can do an append :

$informations->appends(Request::except('page', '_token'))->onEachSide(1)->links()

So, the links under pagination looks like :

http://localhost:81/portail/actualite?theme=0&domaine=1&annee=2020&nombre_resultat_page=10&page=2

Is it possible to have links like a route way ?

http://localhost:81/portail/actualite/theme/0/domaine/1/annee/2020/nombre_resultat_page/10/page/2
0 likes
1 reply
lavelforum's avatar
lavelforum
OP
Best Answer
Level 1

Pagination uses the PHP function http_build_query in laravel\framework\src\Illuminate\Collections\Arr.php

return http_build_query($array, '', '&', PHP_QUERY_RFC3986);

I prefer to to keep as is in place of having a custom function.

Please or to participate in this conversation.