护照使用电子邮件属性作为“用户名”。
我的数据库中的电子邮件列名为“ email1”。我将此代码放在App / User.php类中
public function findForPassport($username)
{
return $this->where('email1', $username)->first();
}
当我尝试通过POST进行身份验证时,收到此错误:
SQLSTATE [42S22]:找不到列:1054'where子句'中的未知列'email'(SQL:从users
中选择*,其中email
= [email protected]限制1)
在登录功能内的logincontroller中,您正在根据电子邮件进行验证。您需要将其更改为email1