我嘗試創建自定義登錄頁面,但我得到一個錯誤laravel 5.2自定義登錄
Undefined index: password
我控制器代碼
$this->validate($Request, [
'Email' => 'required',
'password' => 'required',
]);
$email = $Request['Email'];
$password = md5($Request['password']);
$login = new login();
$login = login::where('Email', $email);
if(empty($password))
{
return('404');
}
if(Auth::attempt(['Email' => $Request->input('Email'), 'Password' =>$password]))
{
return ('ok');
}
return ('no');
任何一個可以幫助我來創建自定義登錄
這是我的新代碼
但我再次GOR未定義::密碼時應
public function logincheck(Request $request)
{
$this->validate($request, [
'Email' => 'required',
'password' => 'required',
]);
$email = $request->Email;
$password = md5($request->get('password'));
if(Auth::attempt(['Email' => $request->get('Email'), 'Password' =>md5($request->get('password'))]))
{
return ('ok');
}
return ('no');
}
顯示你的表格。您的輸入字段的名稱應完全匹配。這是區分大小寫的。 – Christophvh