@if ($paginator->hasPages()) @php $current = $paginator->currentPage(); $last = $paginator->lastPage(); $window = 2; // Seiten links/rechts von aktueller $start = max(1, $current - $window); $end = min($last, $current + $window); @endphp
{{ $paginator->firstItem() }}–{{ $paginator->lastItem() }} von {{ $paginator->total() }}
{{-- Zurück --}} @if ($paginator->onFirstPage()) @else @endif {{-- Erste Seite + … --}} @if ($start > 1) @if ($start > 2) @endif @endif {{-- Seitenfenster --}} @for ($p = $start; $p <= $end; $p++) @if ($p == $current) @else @endif @endfor {{-- … + Letzte Seite --}} @if ($end < $last) @if ($end < $last - 1) @endif @endif {{-- Vor --}} @if ($paginator->hasMorePages()) @else @endif
@endif