Skip to content

Commit e3f48f7

Browse files
authored
[8.x] Fix formatWheres in DatabaseRule (#36441)
* Fix formatWheres in DatabaseRule * Update DatabaseRule.php * Update DatabaseRule.php * Fix styleci
1 parent 81ef985 commit e3f48f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/Validation/Rules/DatabaseRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ public function queryCallbacks()
196196
protected function formatWheres()
197197
{
198198
return collect($this->wheres)->map(function ($where) {
199-
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
199+
if (is_bool($where['value'])) {
200+
return $where['column'].','.($where['value'] ? 'true' : 'false');
201+
} else {
202+
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
203+
}
200204
})->implode(',');
201205
}
202206
}

0 commit comments

Comments
 (0)