getPageRange(); } $pageNumber = $paginator->getCurrentPageNumber(); $pageCount = count($paginator); if ($pageRange > $pageCount) { $pageRange = $pageCount; } $delta = ceil($pageRange / 2); if ($pageNumber - $delta > $pageCount - $pageRange) { $min = $pageCount - $pageRange + 1; $max = $pageCount; } else { if ($pageNumber - $delta < 0) { $delta = $pageNumber; } $offset = $pageNumber - $delta; $min = $offset + 1; $max = $offset + $pageRange; } return $paginator->getPagesInRange($min, $max); } }