From 1d57bf091124a335c53c9f97f0ee3dd7db09ce17 Mon Sep 17 00:00:00 2001 From: Esben Petersen Date: Mon, 4 Jul 2022 15:00:23 +0200 Subject: [PATCH] parse string representations of not and or --- src/LaravelController.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/LaravelController.php b/src/LaravelController.php index 79a4c60..8b355b2 100644 --- a/src/LaravelController.php +++ b/src/LaravelController.php @@ -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 ]; }