diff --git a/resources/views/bootstrap-4/includes/filter-type-multiselect.blade.php b/resources/views/bootstrap-4/includes/filter-type-multiselect.blade.php index 1c777621d..e9a839e65 100644 --- a/resources/views/bootstrap-4/includes/filter-type-multiselect.blade.php +++ b/resources/views/bootstrap-4/includes/filter-type-multiselect.blade.php @@ -1,3 +1,14 @@ +
+ options()) ? 'checked' : ''}} + > + +
@foreach($filter->options() as $optionKey => $value)
+ options()) ? 'checked' : ''}} + > + +
@foreach($filter->options() as $optionKey => $value)
+
+ options()) ? 'checked' : ''}} + > + +
@foreach($filter->options() as $optionKey => $value)
toArray(); } + public function selectAllFilters($filterKey): void + { + $filter = $this->filters()[$filterKey]; + + if (! $filter->isMultiSelect()) { + return; + } + + if (count($this->filters[$filterKey]) === count($filter->options())) { + $this->removeFilter($filterKey); + return; + } + + $this->filters[$filterKey] = array_keys($filter->options()); + } + /** * Define the string location to a view to be included as the filters view *