@if ($paginator->hasPages()) @once @push('seo-head') @if (!$paginator->onFirstPage()) @endif @if ($paginator->hasMorePages()) @endif @endpush @endonce @php $currentPage = $paginator->currentPage(); $lastPage = $paginator->lastPage(); $maxVisible = 5; $half = floor($maxVisible / 2); $startPage = $currentPage - $half; $endPage = $currentPage + $half; if ($startPage < 1) { $startPage = 1; $endPage = min($maxVisible, $lastPage); } if ($endPage > $lastPage) { $endPage = $lastPage; $startPage = max(1, $lastPage - $maxVisible + 1); } @endphp