I am changing my users database table field email to email_id, how do I change that also in Fortify without any custom code and with no errors?
You ask why not custom code because I have to write all the forgot password, reset & many more custom code so I don't want that.
I find this comment in config/fortify.php anyone know how to define email in that or username
/*
|--------------------------------------------------------------------------
| Username / Email
|--------------------------------------------------------------------------
|
| This value defines which model attribute should be considered as your
| application's "username" field. Typically, this might be the email
| address of the users but you are free to change this value here.
|
| Out of the box, Fortify expects forgot password and reset password
| requests to have a field named 'email'. If the application uses
| another name for the field you may define it below as needed.
|
*/
All I can find is this custom solution for the login but I don't want custom code snippets.
Fortify::authenticateUsing(function (Request $request) {
$user = User::where('email_id', $request->email_id)->first();
if ($user &&
Hash::check($request->password, $user->password)) {
return $user;
} else {
return false;
}
});