To customize the page, we should stir a little the structure of the Laravel,
We have to access the file
vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php
leave your methods as the following:
public function getStart()
{
return $this->paginator->getUrlRange(1, 1);
}
public function getFinish()
{
return $this->paginator->getUrlRange(
$this->lastPage(),
$this->lastPage()
);
}
public function getAdjacentUrlRange($onEachSide)
{
return $this->paginator->getUrlRange(
$this->currentPage() - 1,
$this->currentPage() + 1
);
}
protected function getSliderTooCloseToEnding($window)
{
$last = $this->paginator->getUrlRange(
$this->lastPage() - (2),
$this->lastPage()
);
return [
'first' => $this->getStart(),
'slider' => null,
'last' => $last,
];
}
protected function getSliderTooCloseToBeginning($window)
{
return [
'first' => $this->paginator->getUrlRange(1, 3),
'slider' => null,
'last' => $this->getFinish(),
];
}
And that’s it, the magic is done!!!
If you have any questions or would like to know more about these methods I put myself at your disposal to help.
– PV Telles
very well, it worked perfectly, thank you.
– Renne Galli