0
我试图使用Laravel发送恢复邮件。我有以下恢复方法:Laravel - 发送恢复邮件
public function recovery(Request $request)
{
$validator = Validator::make($request->only('email'), [
'email' => 'required'
]);
if($validator->fails()) {
throw new ValidationHttpException($validator->errors()->all());
}
$response = Password::sendResetLink($request->only('email'), function (Message $message) {
$message->subject(Config::get('boilerplate.recovery_email_subject'));
});
switch ($response) {
case Password::RESET_LINK_SENT:
return $this->response->noContent();
case Password::INVALID_USER:
return $this->response->errorNotFound();
}
}
我试图输出$request->email
和复位电子邮件是输出,但由于某些原因,我得到以下错误:
Undefined index: email
at
"/home/pokemoti/public_html/api/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php" on line 74
任何想法可能已经错误?
是否有一个原因,您为什么不使用解决方案中的版本来恢复密码? – Christophvh
没有理由,我有这个版本的laravel有一段时间与不同的内置验证为jwt令牌,我不知道如何在这种情况下我可以使用解决方案中的构建 – TheUnreal
你总是可以启动一个新的测试laravel-项目并运行'php artisan make:auth'并查看重置的处理方式。在这种情况下,您不要搞乱当前的项目。 – Christophvh