laravel10,发送重制邮件报错SQLSTATE[42S02]: Base table or view not found: 1146 Table 'weibo.password_resets' doesn't exist
laravel10默认生成的数据表名称改了,不叫password_resets了,叫password_reset_tokens了,所以app/Http/Controllers/PasswordController.php表里第5步
// 5. 入库,使用 updateOrInsert 来保持 Email 唯一
DB::table('password_resets')->updateOrInsert(['email' => $email], [
'email' => $email,
'token' => Hash::make($token),
'created_at' => new Carbon,
]);
要改成
// 5. 入库,使用 updateOrInsert 来保持 Email 唯一
DB::table('password_reset_tokens')->updateOrInsert(['email' => $email], [
'email' => $email,
'token' => Hash::make($token),
'created_at' => new Carbon,
]);
然后就可以了,但是会跳转两次,不知道是不是哪里还不对。