diff --git a/app/Console/Commands/User/CheckUserEmailExist.php b/app/Console/Commands/User/CheckUserEmailExist.php index 859edd77..5b33f180 100644 --- a/app/Console/Commands/User/CheckUserEmailExist.php +++ b/app/Console/Commands/User/CheckUserEmailExist.php @@ -16,7 +16,7 @@ public function handle(WikiUserEmailChecker $emailChecker): int { foreach ($emails as $email) { $found = false; - if (User::whereEmailInsensitive($email)->exists()) { + if (User::whereEmail($email)->exists()) { $this->line("FOUND: {$email} in apidb.users"); $found = true; } diff --git a/app/User.php b/app/User.php index e809eed8..45459e71 100644 --- a/app/User.php +++ b/app/User.php @@ -121,8 +121,4 @@ public function sendEmailVerificationNotification() { public function getEmailForVerification() { return $this->email; } - - public function scopeWhereEmailInsensitive($query, string $email) { - return $query->whereRaw('LOWER(email) = ?', [strtolower($email)]); - } } diff --git a/tests/Commands/User/CheckUserEmailExistTest.php b/tests/Commands/User/CheckUserEmailExistTest.php index 98dfd20d..e91f1f61 100644 --- a/tests/Commands/User/CheckUserEmailExistTest.php +++ b/tests/Commands/User/CheckUserEmailExistTest.php @@ -61,7 +61,7 @@ public function testCaseInsensitive() { 'email' => 'Test@Example.com', ]); - $exists = User::whereEmailInsensitive('tEsT@eXaMpLe.CoM')->exists(); + $exists = User::whereEmail('tEsT@eXaMpLe.CoM')->exists(); $this->assertTrue($exists); }