Hello I use Laravel version 6.0.4. I use users provider and driver eloquent for retrieve the data from user_table. I use the model App\User
I would like to write in database email like: UpperCase@mail.com and retrieve when I write in login username like : uppercase@mail.com. Finally, I would like to recordind in database like the user put in register form an can retrieve on uppercase ou lowercase.
I already wrote this code in : AuthenticatesUsers. I looked this tips from stackoverflow :
How to make email login case insensitive with Laravel 5.5 authentication How to make email login case insensitive with Laravel 5.5 authentication
But it work only if the database email was write on uppercase.
I would like to know where is the folder where eloquent retrieve email from database for use strtolower on the email field.
I looked in Illuminate\Contracts\Auth\UserProvider or DatabaseUserProvider but I found nothing.
Thank you so much for your help.
Here my code
protected function credentials()
{
$username = $this->username(); //take the email (see function username())
$credentials = request()->only($username, 'password'); //take userrname(email) from page login
if (isset($credentials[$username])) { //Verify if the user entered username
$credentials[$username] = strtolower($credentials[$username]);
}
return $credentials;