1@if (isset($paginator) && $paginator->lastPage() > 1)
2
3 <ul class="pagination">
4
5 <?php
6 $interval = isset($interval) ? abs(intval($interval)) : 3 ;
7 $from = $paginator->currentPage() - $interval;
8 if($from < 1){
9 $from = 1;
10 }
11
12 $to = $paginator->currentPage() + $interval;
13 if($to > $paginator->lastPage()){
14 $to = $paginator->lastPage();
15 }
16 ?>
17
18 <!-- first/previous -->
19 @if($paginator->currentPage() > 1)
20 <li>
21 <a href="{{ $paginator->url(1) }}" aria-label="First">
22 <span aria-hidden="true">«</span>
23 </a>
24 </li>
25
26 <li>
27 <a href="{{ $paginator->url($paginator->currentPage() - 1) }}" aria-label="Previous">
28 <span aria-hidden="true">‹</span>
29 </a>
30 </li>
31 @endif
32
33 <!-- links -->
34 @for($i = $from; $i <= $to; $i++)
35 <?php
36 $isCurrentPage = $paginator->currentPage() == $i;
37 ?>
38 <li class="{{ $isCurrentPage ? 'active' : '' }}">
39 <a href="{{ !$isCurrentPage ? $paginator->url($i) : '#' }}">
40 {{ $i }}
41 </a>
42 </li>
43 @endfor
44
45 <!-- next/last -->
46 @if($paginator->currentPage() < $paginator->lastPage())
47 <li>
48 <a href="{{ $paginator->url($paginator->currentPage() + 1) }}" aria-label="Next">
49 <span aria-hidden="true">›</span>
50 </a>
51 </li>
52
53 <li>
54 <a href="{{ $paginator->url($paginator->lastpage()) }}" aria-label="Last">
55 <span aria-hidden="true">»</span>
56 </a>
57 </li>
58 @endif
59
60 </ul>
61
62@endif
63
1"Showing {{ $products->firstItem() }}–{{ $products->lastItem() }} of {{ $products->total() }} results"