@if ($notifications->hasPages()) @php $current = $notifications->currentPage(); $last = $notifications->lastPage(); $start = max(1, $current - 2); $end = min($last, $current + 2); @endphp @endif