Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 User Model not found

I have moved the User model from the default app directory into app/Models.

I have updated the namespace in User to namespace App\Models; but I am getting this error:

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

I have the correct entry in my json file:

"autoload": {     "classmap": [         "database",         "app/Modules",         "app/Models"     ],     "psr-4": {         "App\\": "app/",         "Modules\\": "app/Modules/"     } }, 

What have I missed?

like image 248
imperium2335 Avatar asked Feb 14 '15 14:02

imperium2335


1 Answers

You need to update your config/auth.php file. Change 'model' => 'App\User' to 'model' => 'App\Models\User'.

like image 162
Martin Bean Avatar answered Oct 02 '22 12:10

Martin Bean