Current Paginator
is using ?page=N
, but I want to use something else. How can I change so it's ?sida=N
instead?
I've looked at Illuminate\Pagination\Environment
and there is a method (setPageName()
) there to change it (I assume), but how do you use it?
In the Paginator
class there is a method the change the base url (setBaseUrl()
) in the Environment
class, but there is no method for setting a page name. Do I really need to extend the Paginator
class just to be able to change the page name?
Just came across this same issue for 5.1
and you can pass the page name like this:
Post::paginate(1, ['*'], 'new-page-name');
Just like you said you can use the setPageName
method:
Paginator::setPageName('sida');
You can place that in app/start/global.php
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With