Skip to content

Commit

Permalink
Fix persist clearfilter (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev authored Feb 4, 2024
1 parent 42eefab commit 4e9213e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Concerns/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,7 @@ public function clearFilter(string $field = '', bool $emit = true): void
$explodeField = explode('.', $field);

$currentArray = &$this->filters[$key];
$lastIndex = array_pop($explodeField);

foreach ($explodeField as $index) {
if (isset($currentArray[$index]) && is_array($currentArray[$index])) {
$currentArray = &$currentArray[$index];
} else {
return;
}
}

unset($currentArray[$lastIndex]);
unset($currentArray[$explodeField[0]]);
}

unset($this->filters[$key][$field]);
Expand Down

0 comments on commit 4e9213e

Please sign in to comment.