Skip to content

Commit

Permalink
Use single quote in raw SQL to fix postgres error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubka committed Apr 14, 2022
1 parent 22b0d12 commit 02ebccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Rules/CaseInsensitiveEmailExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct()
public function passes($attribute, $value)
{
$user = DB::table('users')
->whereRaw('email = "' . strtolower($value) . '"' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''))
->whereRaw('email = \'' . strtolower($value) . '\'' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''))
->first();

return !$user ? false : true;
Expand Down

0 comments on commit 02ebccb

Please sign in to comment.