After a Livewire component re-renders, the pagination path changes to livewire/update/page/, which disrupts the functionality of pagination links.
The Pagi library uses get_pagenum_link, which relies on REQUEST_URI as the reference URL for the path.
To address this, I temporarily modified the REQUEST_URI as follows:
$tmp = $_SERVER['REQUEST_URI'];
$_SERVER['REQUEST_URI'] = $this->baseUrl;
$links = PagiFacade::build()->links();
$_SERVER['REQUEST_URI'] = $tmp;
Is there any other recommended solution to resolve this issue?
Thank you in advance
After a Livewire component re-renders, the pagination path changes to
livewire/update/page/, which disrupts the functionality of pagination links.The Pagi library uses
get_pagenum_link, which relies onREQUEST_URIas the reference URL for the path.To address this, I temporarily modified the
REQUEST_URIas follows:Is there any other recommended solution to resolve this issue?
Thank you in advance