@php $currentPage = $paginator->currentPage(); $lastPage = $paginator->lastPage(); $linksPerPage = $links ?? config('pagination.admin.links', 10); $pageGroupStart = (floor(($currentPage - 1) / $linksPerPage) * $linksPerPage) + 1; $pageGroupEnd = min($pageGroupStart + $linksPerPage - 1, $lastPage); @endphp
{{-- 첫 페이지 버튼 --}} @unless ($paginator->onFirstPage()) 첫 페이지로 이동 @endunless {{-- 이전 페이지 그룹 버튼 --}} @if ($pageGroupStart > 1) @endif
{{-- 페이지 번호 --}} @for ($pageNum = $pageGroupStart; $pageNum <= $pageGroupEnd; $pageNum++) @if ($pageNum == $currentPage) 현재 페이지 {{ $pageNum }} 페이지 @else {{ $pageNum }} 페이지 @endif @endfor
{{-- 다음 페이지 그룹 버튼 --}} @if ($lastPage > $pageGroupEnd) @endif {{-- 마지막 페이지 버튼 --}} @unless ($paginator->onLastPage()) 마지막 페이지로 이동 @endunless