在我的数据库用户表中没有电子邮件,电子邮件存在于另一个表中。因此,当用户重置密码时,我想验证用户输入的邮件,这意味着我将自定义忘记密码控制器以验证另一个表中的电子邮件,所以要这样做吗?
我得到那个错误 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where Clause' (SQL: select * from users
where email
= fds@khy.com limit 1)
我试图覆盖 sendResetLinkEmail 函数,但仍然没有与忘记密码控制器中的代码相同的错误
public function sendResetLinkEmail(Request $request)
{
$this->validate($request, ['email' => 'required|unique:user_emails,email']);
// 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);
}