Skip to content

Commit e76957c

Browse files
committed
fix(Match): Allow bool false for BOOL match
1 parent 10dbe5e commit e76957c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Filters/MatchFilter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function filter(RestifyRequest $request, Builder|Relation $query, $value)
4646
break;
4747
case RestifySearchable::MATCH_BOOL:
4848
case 'boolean':
49-
if ($value === 'false' || $value === '0') {
49+
if ($value === false || $value === 'false' || $value === '0') {
5050
$query->where(function ($query) use ($field) {
5151
if ($this->negation) {
5252
return $query->where($field, true);
@@ -57,6 +57,7 @@ public function filter(RestifyRequest $request, Builder|Relation $query, $value)
5757

5858
break;
5959
}
60+
6061
$query->where($field, $this->negation ? '!=' : '=', true);
6162

6263
break;

0 commit comments

Comments
 (0)