@if ($questions->hasPages()) {{-- Previous Page Link --}} @if ($questions->onFirstPage()) @else @endif {{-- Pagination Elements --}} @php $start = max(1, $questions->currentPage() - 2); $end = min($questions->lastPage(), $questions->currentPage() + 2); @endphp {{-- First page if needed --}} @if ($start > 1) 1 @if ($start > 2) ... @endif @endif {{-- Page numbers --}} @for ($page = $start; $page <= $end; $page++) @if ($page == $questions->currentPage()) {{ $page }} @else {{ $page }} @endif @endfor {{-- Last page if needed --}} @if ($end < $questions->lastPage()) @if ($end < $questions->lastPage() - 1) ... @endif {{ $questions->lastPage() }} @endif {{-- Next Page Link --}} @if ($questions->hasMorePages()) @else @endif {{-- Page Info --}} Showing {{ $questions->firstItem() }} to {{ $questions->lastItem() }} of {{ $questions->total() }} quizzes @endif