📅  最后修改于: 2022-03-11 14:54:13.398000             🧑  作者: Mango
@if ($paginator->lastPage() > 1)
-
First
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
currentPage() - $half_total_links;
$to = $paginator->currentPage() + $half_total_links;
if ($paginator->currentPage() < $half_total_links) {
$to += $half_total_links - $paginator->currentPage();
}
if ($paginator->lastPage() - $paginator->currentPage() < $half_total_links) {
$from -= $half_total_links - ($paginator->lastPage() - $paginator->currentPage()) - 1;
}
?>
@if ($from < $i && $i < $to)
-
{{ $i }}
@endif
@endfor
-
Last
@endif