@if ($paginator->onFirstPage())
«
@else
@endif
@php $pageCount = $paginator->lastPage(); $currentPage = $paginator->currentPage(); $startIndex = $currentPage <= 2 ? 1 : max($currentPage - 2, 1); $endIndex = $currentPage <= 2 ? min($pageCount, 6) : min($currentPage + 2, $pageCount); @endphp @for ($i = $startIndex; $i <= $endIndex; $i++) @if ($i == $currentPage) @else {{ $i }} @endif @endfor @if ($currentPage < $pageCount - 1)
...
{{ $pageCount }} @endif
@if ($paginator->hasMorePages())
@else
»
@endif