Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit d397ef0

Browse files
committed
Add simple pagiantion
1 parent d89c385 commit d397ef0

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

src/LaravelPresetServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ public function boot()
3939
});
4040

4141
Paginator::defaultView('pagination::default');
42+
Paginator::defaultView('pagination::simple-default');
4243
}
4344
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@if ($paginator->hasPages())
2+
<nav>
3+
<div dir="ltr" class="flex font-roboto">
4+
{{-- Previous Page Link --}}
5+
@if ($paginator->onFirstPage())
6+
<a class="py-2 px-4 leading-tight bg-gray-800 border border-gray-700 text-blue-200 border-r-0 ml-0 rounded-l" aria-disabled="true" aria-label="@lang('pagination.previous')">
7+
<span aria-hidden="true">Previous</span>
8+
</a>
9+
@else
10+
<a href="{{ $paginator->previousPageUrl() }}" class="flex items-center mr-1 px-3 py-2 bg-gray-200 text-gray-700 hover:bg-gray-700 hover:text-gray-200 rounded-lg">
11+
<span rel="prev" aria-label="@lang('pagination.previous')">Previous</span>
12+
</a>
13+
@endif
14+
15+
{{-- Next Page Link --}}
16+
@if ($paginator->hasMorePages())
17+
<a href="{{ $paginator->nextPageUrl() }}" class="py-2 px-4 leading-tight bg-gray-800 border border-gray-700 text-blue-200 border-r rounded-r hover:bg-blue-500 hover:text-white">
18+
<span rel="next" aria-label="@lang('pagination.next')">Next</span>
19+
</a>
20+
@else
21+
<a class="py-2 px-4 leading-tight bg-gray-800 border border-gray-700 text-blue-200 border-r rounded-r" aria-disabled="true" aria-label="@lang('pagination.next')">
22+
<span aria-hidden="true">Next</span>
23+
</a>
24+
@endif
25+
</div>
26+
</nav>
27+
@endif
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@if ($paginator->hasPages())
2+
<nav>
3+
<div class="flex rounded">
4+
{{-- Previous Page Link --}}
5+
@if ($paginator->onFirstPage())
6+
<a class="py-2 px-4 leading-tight bg-white border border-gray-200 text-blue-700 border-r-0 ml-0 rounded-l" aria-disabled="true" aria-label="@lang('pagination.previous')">
7+
<span aria-hidden="true">Previous</span>
8+
</a>
9+
@else
10+
<a href="{{ $paginator->previousPageUrl() }}" class="fpy-2 px-4 leading-tight bg-white border border-gray-200 text-blue-700 border-r-0 hover:bg-blue-500 hover:text-white">
11+
<span rel="prev" aria-label="@lang('pagination.previous')">Previous</span>
12+
</a>
13+
@endif
14+
15+
{{-- Next Page Link --}}
16+
@if ($paginator->hasMorePages())
17+
<a href="{{ $paginator->nextPageUrl() }}" class="py-2 px-4 leading-tight bg-white border border-gray-200 text-blue-700 border-r hover:bg-blue-500 hover:text-white rounded-r">
18+
<span rel="next" aria-label="@lang('pagination.next')">Next</span>
19+
</a>
20+
@else
21+
<a class="py-2 px-4 leading-tight bg-white border border-gray-200 text-blue-700 border-r" aria-disabled="true" aria-label="@lang('pagination.next')">
22+
<span aria-hidden="true">Next</span>
23+
</a>
24+
@endif
25+
</div>
26+
</nav>
27+
@endif

0 commit comments

Comments
 (0)