@if ($projects->lastPage() > 1)
    @if ($projects->onFirstPage()) @else
  • <<
  • @endif @php $currentPage = $projects->currentPage(); $lastPage = $projects->lastPage(); $maxPages = 5; // Number of pages to display initially $startPage = max($currentPage - floor($maxPages/2), 1); $endPage = min($startPage + $maxPages - 1, $lastPage); @endphp @if ($startPage > 1)
  • 1
  • @if ($startPage > 2)
  • ...
  • @endif @endif @for ($i = $startPage; $i <= $endPage; $i++) @if ($i == $currentPage)
  • {{ $i }}
  • @else
  • {{ $i }}
  • @endif @endfor @if ($endPage < $lastPage) @if ($endPage < $lastPage - 1)
  • ...
  • @endif
  • {{ $lastPage }}
  • @endif @if ($projects->hasMorePages())
  • >>
  • @else @endif
@endif