Skip to content

Commit

Permalink
Merge pull request #72 from Angelinsky7/not-filter
Browse files Browse the repository at this point in the history
[2.x] Not filter
  • Loading branch information
gentritabazi committed May 10, 2021
2 parents 6ab82b5 + f87755a commit 6d2c7e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Another available parameter is `filterByOr`, `search` and `searchByOr`.

* **columnName** - (Required) - Name of column you want to filter, for relationships use `dots`.
* **operator** - (Optional | Default: `eq`) Type of operator you want to use.
* **not** - (Optional | Default: `false`) Negate the filter (Accepted values: yes|true|1).
* **not** - (Optional | Default: `false`) Negate the filter (Accepted values: not|yes|true|1).

#### Example filters

Expand Down
1 change: 1 addition & 0 deletions src/Controllers/LaravelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ protected function parseFilters(array $filters, $or = false, $defaultOperator =

if (is_array($part)) {
$not = ($arrayCountValues == 2) ? key($part[$operator]) : false;
$not = $not === 'not' ? true : $not;
$not = $not ? filter_var($not, FILTER_VALIDATE_BOOLEAN) : false;

$value = $part[(string)key($part)];
Expand Down

0 comments on commit 6d2c7e7

Please sign in to comment.