File tree Expand file tree Collapse file tree 5 files changed +49
-38
lines changed Expand file tree Collapse file tree 5 files changed +49
-38
lines changed Original file line number Diff line number Diff line change 44
55trait FilterConfiguration
66{
7- public function setFiltersStatus (bool $ status ): self
8- {
9- $ this ->filtersStatus = $ status ;
10-
11- return $ this ;
12- }
13-
14- public function setFiltersEnabled (): self
15- {
16- $ this ->setFiltersStatus (true );
17-
18- return $ this ;
19- }
20-
21- public function setFiltersDisabled (): self
22- {
23- $ this ->setFiltersStatus (false );
24-
25- return $ this ;
26- }
277}
Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ trait HandlesFilterTraits
99 HasFilterMenuStyling,
1010 HasFilterPillsStyling,
1111 HasFilterQueryString,
12+ HasFiltersStatus,
1213 HasFiltersVisibility;
1314}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rappasoft \LaravelLivewireTables \Traits \Core \Filters ;
4+
5+ use Livewire \Attributes \Locked ;
6+
7+ trait HasFiltersStatus
8+ {
9+ #[Locked]
10+ public bool $ filtersStatus = true ;
11+
12+ public function getFiltersStatus (): bool
13+ {
14+ return $ this ->filtersStatus ;
15+ }
16+
17+ public function filtersAreEnabled (): bool
18+ {
19+ return $ this ->getFiltersStatus () === true ;
20+ }
21+
22+ public function filtersAreDisabled (): bool
23+ {
24+ return $ this ->getFiltersStatus () === false ;
25+ }
26+
27+
28+ public function setFiltersStatus (bool $ status ): self
29+ {
30+ $ this ->filtersStatus = $ status ;
31+
32+ return $ this ;
33+ }
34+
35+ public function setFiltersEnabled (): self
36+ {
37+ $ this ->setFiltersStatus (true );
38+
39+ return $ this ;
40+ }
41+
42+ public function setFiltersDisabled (): self
43+ {
44+ $ this ->setFiltersStatus (false );
45+
46+ return $ this ;
47+ }
48+ }
Original file line number Diff line number Diff line change 1111
1212trait FilterHelpers
1313{
14- public function getFiltersStatus (): bool
15- {
16- return $ this ->filtersStatus ;
17- }
18-
19- public function filtersAreEnabled (): bool
20- {
21- return $ this ->getFiltersStatus () === true ;
22- }
23-
24- public function filtersAreDisabled (): bool
25- {
26- return $ this ->getFiltersStatus () === false ;
27- }
28-
2914 public function hasFilters (): bool
3015 {
3116 return $ this ->getFiltersCount () > 0 ;
Original file line number Diff line number Diff line change @@ -14,9 +14,6 @@ trait WithFilters
1414 FilterHelpers;
1515 use HandlesFilterTraits;
1616
17- #[Locked]
18- public bool $ filtersStatus = true ;
19-
2017 #[Locked]
2118 public int $ filterCount ;
2219
You can’t perform that action at this time.
0 commit comments