Use single quote in raw SQL to fix postgres error

This commit is contained in:
Bubka 2022-04-14 15:13:10 +02:00
parent 22b0d1293f
commit 02ebccb4de

View File

@ -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;