Skip to content

Commit

Permalink
[8.x] Fix formatWheres in DatabaseRule (#36441)
Browse files Browse the repository at this point in the history
* Fix formatWheres in DatabaseRule

* Update DatabaseRule.php

* Update DatabaseRule.php

* Fix styleci
  • Loading branch information
lloricode authored Mar 3, 2021
1 parent 81ef985 commit e3f48f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Validation/Rules/DatabaseRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ public function queryCallbacks()
protected function formatWheres()
{
return collect($this->wheres)->map(function ($where) {
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
if (is_bool($where['value'])) {
return $where['column'].','.($where['value'] ? 'true' : 'false');
} else {
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
}
})->implode(',');
}
}

0 comments on commit e3f48f7

Please sign in to comment.