Class '\App\User' not found in Laravel when changing the namespace
问题 I am having this error when moving User.php to Models/User.php local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Class '\App\User' not found vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:126 回答1: Go to config/auth.php and change App\User:class to App\Models\User::class. 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], Also change the namespace of User.php model namespace App\Models; 回答2: These