错误信息是由数据库中的错误字段引起的.
The error informatin is caused by the incorrect field in the database.
QueryException in Connection.php line 620: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause'
QueryException in Connection.php line 620: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause'
auth的默认字段与数据库字段不同,我想在auth中使用数据库字段.
The default field of auth is different from the database field, I want to use the database field in auth.
例如:数据库调用user_email中的email字段,我想将数据库字段更改为auth字段.
For example: the email field in my database call user_email, I want to change the database field into the auth field.
那么,有什么办法可以做到这一点? 对不起,我的英语不好:)
So, Are there any way to do this ? Sorry for my poor English :)
THX;
推荐答案您可以在控制器的Auth :: attemp方法中设置所需的任何列.
You can set whatever columns you like in the Auth::attemp method in your controller.
在您的情况下,以下构造应该起作用
In your case bewlow construct should work
Auth::attempt(['user_email' => $email, 'password' => $password]更多推荐
将Laravel 5 Auth与自定义表字段名称一起使用?
发布评论