Skip to content

Commit 23a6a30

Browse files
committed
Add ability to turn off per page selector without disabling pagination
1 parent 90491a1 commit 23a6a30

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ 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+
713
## [0.1.2] - 2020-04-28
814

915
### Changed
@@ -20,6 +26,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
2026

2127
- Initial release
2228

23-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...development
29+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...development
30+
[0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
2431
[0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
2532
[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: 8 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
*

0 commit comments

Comments
 (0)