Skip to content

Commit 7b70d88

Browse files
committed
Merge branch 'master' of https://github.com/abdosaeedelhassan/laravel-livewire-tables into abdosaeedelhassan-master
2 parents 6d3c5d7 + cac5010 commit 7b70d88

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

resources/views/includes/_options.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
@if ($searchEnabled)
2222
<div class="col">
2323
<input
24-
@if (is_numeric($searchDebounce)) wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
24+
@if (is_numeric($searchDebounce)&&$searchType=='debounce') wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
25+
@if ($searchType=='lazy') wire:model.lazy="search" @endif
2526
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
2627
class="form-control"
2728
type="text"

resources/views/includes/_pagination.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66

77
<div class="col text-right text-muted">
8-
{{ __('Showing :first to :last out of :total results', ['first' => $models->count() ? $models->firstItem() : 0, 'last' => $models->count() ? $models->lastItem() : 0, 'total' => $models->total()]) }}
8+
{{ __($shownLabel.' :first '.$toLabel.' :last '.$outOfLabel.' :total '.$resultsLable, ['first' => $models->count() ? $models->firstItem() : 0, 'last' => $models->count() ? $models->lastItem() : 0, 'total' => $models->total()]) }}
99
</div>
1010
</div>
1111
@endif

src/Traits/Pagination.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,34 @@ trait Pagination
4747
*/
4848
public $perPageLabel;
4949

50+
/**
51+
* The label for shown string.
52+
*
53+
* @var string
54+
*/
55+
public $shownLabel='Showing';
56+
57+
/**
58+
* The label for results string.
59+
*
60+
* @var string
61+
*/
62+
public $resultsLable='results';
63+
64+
/**
65+
* The label for out of string.
66+
*
67+
* @var string
68+
*/
69+
public $outOfLabel='out of';
70+
71+
/**
72+
* The label for to string.
73+
*
74+
* @var string
75+
*/
76+
public $toLabel='to';
77+
5078
/**
5179
* https://laravel-livewire.com/docs/pagination
5280
* Resetting Pagination After Filtering Data.

src/Traits/Search.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ trait Search
1111
* Search.
1212
*/
1313

14+
15+
/**
16+
* Whether search work: debounce or lazy
17+
* @var string
18+
*/
19+
public $searchType = 'debounce';
20+
1421
/**
1522
* Whether or not searching is enabled.
1623
*

0 commit comments

Comments
 (0)