Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix formatWheres in DatabaseRule
  • Loading branch information
lloricode authored Mar 3, 2021
commit fbd9a4bc01ff8f9995cd0f5cb00f92db5cd8669b
8 changes: 6 additions & 2 deletions src/Illuminate/Validation/Rules/DatabaseRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ public function queryCallbacks()
*/
protected function formatWheres()
{
return collect($this->wheres)->map(function ($where) {
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
return collect($this->wheres)->map( function ($where) {
if (is_bool($where['value'])) {
return $where['column'].','.'true';
} else {
return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"';
}
})->implode(',');
}
}