本文介绍了更改名称空间时在Laravel中找不到类'\ App \ User'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将User.php
移至Models/User.php
vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:126
vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:126
推荐答案
转到config/auth.php,将App \ User:class更改为App \ Models \ User :: class.
Go to config/auth.php and change App\User:class to App\Models\User::class.
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
还更改User.php模型的命名空间
Also change the namespace of User.php model
namespace App\Models;
这篇关于更改名称空间时在Laravel中找不到类'\ App \ User'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!