Laravel namespacing and authentication

- 1 answer

Ad

I'm working with a Laravel 5.2 test site, and I'm using the built-in auth system to handle logins.

I changed the name of the app namespace to myTest using php artisan app:name myTest

However, when I submit the login form I'm still getting an error due to a namespace issue in the auth system:

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

Is there somewhere I need to edit the namespace so that this will work?

EDIT: PSR4 block of composer.json is:

"psr-4": {
    "myTest\\": "app/"
}

Yes, I did already composer dump-autoload to try to refresh the namespacing, and the same issue appears.

Ad

Answer

Ad

You need to update your config/auth.php file.

Check under providers ->users ->model.

Adjust that from App\User::class to your class.

Ad
source: stackoverflow.com
Ad