@if ($paginator->hasPages()) @php $totalPage = $paginator->lastPage(); $pageGroup = ceil($paginator->currentPage() / 5); $last = $pageGroup * 5; $first = $last - 4; $last = ($overFlow = $last > $totalPage) ? $totalPage : $last; @endphp {{-- {{ dd( $first) }}--}} {{-- dd( $totalPage);--}} {{-- {{ dd(($pageGroup - 1) * 5) }}--}} {{-- {{ dd($paginator->currentPage()) }}--}} {{-- {{ dd((($pageGroup + 1) * 5) - 4) }}--}} @endif