Support the ongoing development of Laravel.io →
Authentication Security Eloquent

FatalErrorException in EloquentUserProvider.php line 126: Class '\App\User' not found

So, I really wasn't keen on having all the models at the root of the App folder in laravel 5.1.

So I created a new folder and placed all the model php files within it: \App\Models...

I altered the auth controller to use the new 'use App\Models\User;' and corrected all the model files within the model folder..

However when i load the page I get the error mentioned above.

Is it possible to tell Laravel that I have moved the User.php model?

Last updated 3 years ago.
0

Change all the references of App\User to App\Users\Models in the code with a simple search in the document you'll be ok. Then autoload composer

0

Sign in to participate in this thread!

Eventy

Your banner here too?

johnc1984 johnc1984 Joined 28 Nov 2015

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.

© 2025 Laravel.io - All rights reserved.