Laravel 错误“找不到类'App\http\Controllers\DateTime'”
2022-08-30 16:00:51
public function recover(Request $request){
$email = $request->input('email');
// Create tokens
$selector = bin2hex(random_bytes(8));
$token = random_bytes(32);
$url = sprintf('%s', route('recover.reset',['selector'=>$selector, 'validator'=>bin2hex($token)]));
// Token expiration
$expires = new DateTime('NOW');
$expires->add(new DateInterval('PT01H')); // 1 hour
// Delete any existing tokens for this user
DB::delete('delete * from password_reset where email =?', $email);
// Insert reset token into database
$insert = $this->db->insert('password_reset',
array(
'email' => $email,
'selector' => $selector,
'token' => hash('sha256', $token),
'expires' => $expires->format('U'),
)
);
我正在尝试实现忘记密码时,电子邮件表单被提交给foreverPasswordController,它会生成以下错误
“找不到'应用程序\Http\控制器\日期时间'类”
这是控制器的图片上面的代码是没有,我不能修改它恢复密码控制器图像
在标题我已尝试使用
use DateTime;
或
use App\Http\Controllers\DateTime
但仍然产生相同的错误,请帮助修复它。提前致谢