{{-- Footer + pager. Pass `paginator` for a real LengthAwarePaginator; the `count` fallback keeps the static mock tables on the detail page rendering as before. --}} @props([ 'count' => 0, 'paginator' => null, ]) @php $total = $paginator ? $paginator->total() : $count; // A sliding window of at most five page links, so a long result set does // not push a hundred buttons into the footer. $window = []; if ($paginator && $paginator->hasPages()) { $last = $paginator->lastPage(); $start = max(1, min($paginator->currentPage() - 2, $last - 4)); $window = $paginator->getUrlRange($start, min($last, $start + 4)); } @endphp