Mostrando {{ $items->firstItem() ?? 0 }} a {{ $items->lastItem() ?? 0 }}
de {{ $items->total() }} resultados
@if ($items->onFirstPage())
@else
@endif
@php
$currentPage = $items->currentPage();
$lastPage = $items->lastPage();
$start = max(1, $currentPage - 3);
$end = min($lastPage, $currentPage + 3);
// Ajustar para mostrar siempre 10 números cuando sea posible
if ($end - $start < 4) {
if ($start == 1) {
$end = min($lastPage, $start + 4);
} else {
$start = max(1, $end - 4);
}
}
@endphp
@if($start > 1)
@if($start > 2)
...
@endif
@endif
@foreach (range($start, $end) as $page)
@if ($page == $currentPage)
@else
@endif
@endforeach
@if($end < $lastPage)
@if($end < $lastPage - 1)
...
@endif
@endif
@if ($items->hasMorePages())
@else
@endif