gpt4 book ai didi

laravel - PHP fatal error : Class 'App\\User' not found in/home/e/eraser/domains/domain. com/app/Http/Controllers/Auth/RegisterController.php 第 100 行

转载 作者:行者123 更新时间:2023-12-02 10:17:12 24 4
gpt4 key购买 nike

注册表单不起作用。我在 Apache 错误日志中收到此错误...

RegisterController.php 行 return User::create([:

protected function create(array $data)
{
return User::create([
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}

auth.php:

'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
]

最佳答案

由于您更改了用户模型的命名空间,您还必须更新 RegisterController 文件顶部的 use 语句

改变这个

use App\User;

到此

use App\Models\User;

关于laravel - PHP fatal error : Class 'App\\User' not found in/home/e/eraser/domains/domain. com/app/Http/Controllers/Auth/RegisterController.php 第 100 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58626885/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com