@if ($paginator->hasPages()) {{-- --}} @if ($paginator->onFirstPage()) @else @endif @foreach ($elements as $element) {{-- @if (is_string($element)) {{ $element }} @endif --}} @if (is_array($element)) @foreach ($element as $page => $url) @if ($paginator->currentPage() > 4 && $page === 2) ... @endif @if ($page == $paginator->currentPage()) {{ $page }} @elseif ($page === $paginator->currentPage() + 1 || $page === $paginator->currentPage() + 2 || $page === $paginator->currentPage() - 1 || $page === $paginator->currentPage() - 2 || $page === $paginator->lastPage() || $page === 1) {{ $page }} @endif @if ($paginator->currentPage() < $paginator->lastPage() - 3 && $page === $paginator->lastPage() - 1) ... @endif @endforeach @endif @endforeach {{-- @if($paginator->currentPage() > 3) 1 @endif @if($paginator->currentPage() > 4) ... @endif @foreach(range(1, $paginator->lastPage()) as $i) @if($i >= $paginator->currentPage() - 2 && $i <= $paginator->currentPage() + 2) @if ($i == $paginator->currentPage()) {{ $i }} @else {{ $page }} @endif @endif @endforeach @if($paginator->currentPage() < $paginator->lastPage() - 3) ... @endif @if($paginator->currentPage() < $paginator->lastPage() - 2) {{ $paginator->lastPage() }} @endif --}} @if ($paginator->hasMorePages()) @else @endif @endif