【发布时间】:2018-11-13 18:10:58
【问题描述】:
我想在同一页面上注册/登录和发送密码重置。
我实现了使用不同的输入名称在同一页面上注册和登录。但是我没有找到添加密码重置输入的方法。
我想将其称为“reset_email”,但在我的控制器上,如果我尝试:
public function sendResetLinkEmail(Request $request)
{
$this->validateEmail($request);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$request->only('email')
);
return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($response)
: $this->sendResetLinkFailedResponse($request, $response);
}
/**
* Validate the email for the given request.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function validateEmail(Request $request)
{
$this->validate($request, ['reset_email' => 'required|email']);
}
我遇到了这个错误:
我们找不到使用该电子邮件地址的用户。
知道如何使用 reset_email 而不是 email 作为我的输入名称吗?
感谢您的帮助。
【问题讨论】: