Apr 4, 2023
0
Level 3
Overwrite pagination url path
How do you correctly use currentPathResolver?
Paginator::currentPathResolver(fn ($pageName = 'page') => $this->url . '?' . $pageName);
https://test.local/blog?page=&=2
Paginator::currentPathResolver(fn ($pageName = 'page') => $this->url);
Reason for this is because I need to overwrite the url path inside a livewire component.
Note that this is called currentPathResolver before Posts::query()->paginate() and not from a service provider.
Please or to participate in this conversation.