0

I tried following these steps to no avail https://stackoverflow.com/a/64299968/7309037

I have a User Table with the column name "EmailAddress" but Laravel is looking for "email" and I get the following error when trying to login:

SQLSTATE[42S22]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'email'. (SQL: select top 1 * from [User] where [email] = test1@gmail.com) A column was not found

Bagus Tesa
  • 1,317
  • 2
  • 19
  • 42
Carlos Castillo
  • 151
  • 2
  • 2
  • 8

1 Answers1

0

Have you tried this: https://laravel.com/docs/9.x/fortify#customizing-user-authentication

Add the following code to your FortifyServiceProvider file in the boot method:

Fortify::authenticateUsing(function (Request $request) {
        $user = User::where('EmailAddress', $request->email)->first();
 
        if ($user &&
            Hash::check($request->password, $user->password)) {
            return $user;
        }
    });
Yannick Beuchat
  • 241
  • 2
  • 6