Para customizar a páginação, devemos mexer um pouco na estrutura do laravel,
Temos que acessar o arquivo do laravel
vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php
deixe seus métodos conforme os seguintes:
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(),
];
}
E pronto, a mágica ta feita!!!