Laravel 8.55 with Fortify showing Class 'App\Providers\User' not found while login

I have installed laravel 8.55.0 and installed fortify with it for the authentication handling. Registration is working fine and login also validation is working fine. but when I enter email and password (either right or wrong) it’s displaying Class ‘App\Providers\User’ not found I checked all files but cannot find the problem, can you guys please suggest a good solution for the problem:

Validation is working
Laravel 8.55 with Fortify showing Class 'App\Providers\User' not found while login

Error
Laravel 8.55 with Fortify showing Class 'App\Providers\User' not found while login

The error says there is the problem with this line
Laravel 8.55 with Fortify showing Class 'App\Providers\User' not found while login

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

in App\Providers\FortifyServiceProvider.php add this line:

use App\Models\User;

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply