2017-02-01 4 views
0

나는 Laravel 5.2 응용 프로그램에서 일하고 있습니다. 나는 인증 모듈을 구현하고 있었다. 문제는 내가 이라는 전자 메일 대신 메일 열을 가지고 있지 않다는 것입니다. 모듈의 기본 사용자 테이블을 사용하지 않기 때문입니다. 는 그래서, 등록, loging 및 로그 아웃이 제대로 작동 지금 쯤 AuthController에 내가 설정 때문에 : 반면에,변경 사용 열에서 암호

protected $username = 'mail'; 

하지만, 여전히 email 열을 찾고 있기 때문에 ResetPassword이 작동하지 않습니다 나에게이 오류주고 : 대신 내가 필요,

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from `users` where `email` = [email protected] limit 1 

나는 그것이 email을 비교하는 것을 원하지 않는를 mail

+0

'https : // github.com/laravel/framework/blob/5.2/src/Illuminate/Auth/AuthenticatesUsers.php # L141'에있는'loginUsername()'함수를'return property_exists $ this, 'username')? $ this-> username : '메일'; – Troyer

답변

0

Settingup 같은 getEmailForPasswordReset() 방법 사용자에 모델 :

public function getEmailForPasswordReset() { 
    //Place you reset code here... 
} 

REF : change User email field to username field with Laravel 5.0? 또한 자격 증명과 일치하지 않습니다 'postLogin()', 그렇지 않으면 기본 인증 시스템을 재정의 할 필요가

.