Skip to content

Commit

Permalink
Fix enabled filters bug (#1462)
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Mar 14, 2024
1 parent 590b369 commit 4866e84
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Concerns/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,9 @@ private function resolveFilters(): void

data_set($column, 'filters', (array) $filter);

if (isset($this->filters[data_get($filter, 'key')])
if (isset($this->filters[data_get($filter, 'field')])
&& in_array(data_get($filter, 'field'), array_keys($this->filters[data_get($filter, 'key')]))
&& array_values($this->filters[data_get($filter, 'key')])
&& !in_array(data_get($filter, 'field'), array_column($this->enabledFilters, 'field'))) {
&& array_values($this->filters[data_get($filter, 'key')])) {
$this->enabledFilters[] = [
'field' => data_get($filter, 'field'),
'label' => data_get($column, 'title'),
Expand Down

0 comments on commit 4866e84

Please sign in to comment.