Support the ongoing development of Laravel.io →
Laravel Authentication
Last updated 2 years ago.
0

I have found the solution for this. I am using Laravel 5.8.17.

Auth::attempt() will not work for the custom fields, the reason for this is the provider (Eloquent). vendor\laravel\framework\src\Illuminate\Auth\EloquentUserProvider.php.

In the above file go to this function retrieveByCredentials, then you can see the code that password column is static. For testing, you can update that column and try it. But it is not recommended to do it.

So to solve this issue create your custom provider class and use that in config/auth.php to make it work.

People who are using Database provider can see the function retrieveByCredentials in the below file. vendor\laravel\framework\src\Illuminate\Auth\DatabaseUserProvider.php.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.