@if ($paginator->items()) {{-- SELECT ITEMS PER PAGE --}} {{ $paginator->perPage() }} @foreach (\Domain\Enums\Pagination\ItemsPerPaginationEnum::cases() as $itemsPerPaginationEnum) {{ $itemsPerPaginationEnum->value }} @endforeach @if ($paginator->hasPages()) {{-- PAGINATION --}} {{-- PREVIOUS PAGE --}} onFirstPage()) href="{{ request()->fullUrlWithQuery(['page' => $paginator->currentPage() - 1]) }}" @endif rel="prev" @if ($paginator->onFirstPage()) aria-hidden="true" disabled @endif> {{ __('pagination.previous_page') }} {{-- FIRST PAGE --}} @if ($paginator->currentPage() > 3) 1 @endif {{-- HIDE PAGES TOO FAR --}} @if ($paginator->currentPage() > 4) ... @endif {{-- SHOW ACTUAL PAGES + N-2/N+2 --}} @foreach (range(1, $paginator->lastPage()) as $i) @if ($i >= $paginator->currentPage() - 2 && $i <= $paginator->currentPage() + 2) @if ($i == $paginator->currentPage()) {{ $i }} @for ($i = 1; $i <= $paginator->lastPage(); $i++) {{ $i }} @endfor @else {{ $i }} @endif @endif @endforeach {{-- HIDE PAGES TOO FAR --}} @if ($paginator->currentPage() < $paginator->lastPage() - 3) ... @endif {{-- LAST PAGE --}} @if ($paginator->currentPage() < $paginator->lastPage() - 2) {{ $paginator->lastPage() }} @endif {{-- NEXT PAGE --}} hasMorePages()) href="{{ request()->fullUrlWithQuery(['page' => $paginator->currentPage() + 1]) }}" @endif rel="next" @if (!$paginator->hasMorePages()) aria-hidden="true" disabled @endif> {{ __('pagination.next_page') }} @endif @push('styles') @endpush @endif