Skip to content

Commit

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

This reverts commit f927dc7.
  • Loading branch information
taylorotwell authored Mar 3, 2021
1 parent f927dc7 commit 0183148
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 0183148

Please sign in to comment.