Skip to content

Commit

Permalink
parse string representations of not and or
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp committed Jul 4, 2022
1 parent 421f76e commit 1d57bf0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/LaravelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,29 @@ protected function parseFilterGroups(array $filter_groups)
$filter['not'] = false;
}

if (array_key_exists('not', $filter)) {
if ($filter['not'] === 'true') {
$filter['not'] = true;
} else if ($filter['not'] === 'false') {
$filter['not'] = false;
}
}

return $filter;
}, $group['filters']);

$or = false;
if (array_key_exists('or', $group)) {
if ($group['or'] === 'true') {
$group['or'] = true;
} else if ($group['or'] === 'false') {
$group['or'] = false;
}
}

$return[] = [
'filters' => $filters,
'or' => isset($group['or']) ? $group['or'] : false
'or' => $or
];
}

Expand Down

0 comments on commit 1d57bf0

Please sign in to comment.