Level 31
Anyone?! :)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone,
I want to rename the ?page=42 parameter name globally. Currently, what I've done is to use something like this:
// AppServiceProvider.php
public function boot()
{
Paginator::currentPageResolver(function() {
return $this->app['request']->input('seite');
});
}
// XxxController.php
public function index()
{
$companies = Company::paginate()->setPageName('seite');
return view('companies.index', compact('companies'));
}
This works as expected!
Is there a way to set this globally (e.g. define the name in a service provider?)
Thanks in advance!!
Please or to participate in this conversation.