Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move the laravel 5.1 User model to \App\Models\User?

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

Laravel 5.1

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

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.

(the other model files of course work fine as it is my code accessing them, it is just the prebuilt auth stuff from laravel 5.1)


1 Answers

You need to modify your Project/config/auth.php file on 'model'=> AppName\Models\User::class,

like image 146
JP Blanco Avatar answered Sep 12 '25 22:09

JP Blanco