我在laravel 5中使用限制创建自定义登录但我继续收到上述错误:
laravel"方法[hasTooManyLoginAttempts]不存在。"
这是我的代码:
public function loginUsers(Request $request)
{
$this->validate($request, [
'email' => 'required',
'password' => 'required',
]);
if ($this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
$email = $request->get('email');
$password = $request->get('password');
$remember = $request->get('remember');
if ($this->auth->attempt([
'email' => $email,
'password' => $password,
], $remember == 1 ? true : false)) {
$request->session()->regenerate();
$this->clearLoginAttempts($request);
return redirect()->route('front-product.index');
}
else {
$this->incrementLoginAttempts($request);
return redirect()->back()
->with('message','Incorrect username or password')
->with('status', 'danger')
->withInput();
}
}