Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rappasoft committed May 13, 2020
2 parents e0020fe + 96e8dce commit d066461
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to `laravel-livewire-tables` will be documented in this file

## [Unreleased]

## [0.1.3] - 2020-05-12

### Changed

- Ability to turn off per page option while keeping pagination on
- Fix the search feature if pagination is on, and you're not searching from the first page using Livewire's native resetPage() method.

## [0.1.2] - 2020-04-28

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

- Initial release

[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...development
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...development
[0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ You can override any of these in your table component:

| Property | Default | Usage |
| -------- | ------- | ----- |
| $paginationEnabled | true | Displays per page and pagination links |
| $paginationEnabled | true | Enables or disables pagination as a whole |
| $perPageEnabled | true | Displays per page |
| $perPageOptions | [10, 25, 50] | The options to limit the amount of results per page |
| $perPage | 25 | Amount of items to show per page |
| $perPageLabel | Per Page | The label for the per page filter |
Expand Down
4 changes: 2 additions & 2 deletions resources/views/includes/_options.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if ($paginationEnabled || $searchEnabled)
<div class="row mb-4">
@if ($paginationEnabled)
@if ($paginationEnabled && $perPageEnabled)
<div class="col form-inline">
{{ $perPageLabel }}: &nbsp;

Expand All @@ -22,7 +22,7 @@
<div class="col">
<input
@if (is_numeric($searchDebounce)) wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
class="form-control"
type="text"
placeholder="{{ $searchLabel }}"
Expand Down
17 changes: 17 additions & 0 deletions src/Traits/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ trait Pagination
*/
public $paginationEnabled = true;

/**
* Whether or not the per page checker is visible
* Can have pagination on with the per page off.
*
* @var bool
*/
public $perPageEnabled = true;

/**
* The options to limit the amount of results per page.
*
Expand All @@ -38,4 +46,13 @@ trait Pagination
* @var string
*/
public $perPageLabel;

/**
* https://laravel-livewire.com/docs/pagination
* Resetting Pagination After Filtering Data.
*/
public function updatingSearch(): void
{
$this->resetPage();
}
}

0 comments on commit d066461

Please sign in to comment.