Skip to content

Commit 94782c4

Browse files
committed
Merge branch 'develop'
2 parents 2c04dea + 8253be5 commit 94782c4

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
44

55
## [Unreleased]
66

7+
## [0.1.3] - 2020-05-12
8+
9+
### Changed
10+
11+
- Ability to turn off per page option while keeping pagination on
12+
- Fix the search feature if pagination is on, and you're not searching from the first page using Livewire's native resetPage() method.
13+
714
## [0.1.2] - 2020-04-28
815

916
### Changed
@@ -20,6 +27,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
2027

2128
- Initial release
2229

23-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...development
30+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...development
31+
[0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
2432
[0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
2533
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ You can override any of these in your table component:
177177

178178
| Property | Default | Usage |
179179
| -------- | ------- | ----- |
180-
| $paginationEnabled | true | Displays per page and pagination links |
180+
| $paginationEnabled | true | Enables or disables pagination as a whole |
181+
| $perPageEnabled | true | Displays per page |
181182
| $perPageOptions | [10, 25, 50] | The options to limit the amount of results per page |
182183
| $perPage | 25 | Amount of items to show per page |
183184
| $perPageLabel | Per Page | The label for the per page filter |

resources/views/includes/_options.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@if ($paginationEnabled || $searchEnabled)
22
<div class="row mb-4">
3-
@if ($paginationEnabled)
3+
@if ($paginationEnabled && $perPageEnabled)
44
<div class="col form-inline">
55
{{ $perPageLabel }}: &nbsp;
66

@@ -22,7 +22,7 @@
2222
<div class="col">
2323
<input
2424
@if (is_numeric($searchDebounce)) wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
25-
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
25+
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
2626
class="form-control"
2727
type="text"
2828
placeholder="{{ $searchLabel }}"

src/Traits/Pagination.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ trait Pagination
1818
*/
1919
public $paginationEnabled = true;
2020

21+
/**
22+
* Whether or not the per page checker is visible
23+
* Can have pagination on with the per page off.
24+
*
25+
* @var bool
26+
*/
27+
public $perPageEnabled = true;
28+
2129
/**
2230
* The options to limit the amount of results per page.
2331
*
@@ -38,4 +46,13 @@ trait Pagination
3846
* @var string
3947
*/
4048
public $perPageLabel;
49+
50+
/**
51+
* https://laravel-livewire.com/docs/pagination
52+
* Resetting Pagination After Filtering Data.
53+
*/
54+
public function updatingSearch(): void
55+
{
56+
$this->resetPage();
57+
}
4158
}

0 commit comments

Comments
 (0)