/**
* Get the throttle key for the given request.
*
* @param \Illuminate\Http\Request $request
* @return string
*/protectedfunctionthrottleKey(Request $request){if(config('custom.throttle_key')==='ip'){return$request->ip();}return Str::lower($request->input($this->username())).'|'.$request->ip();}
源码
/**
* 重写login方法 让他在出错的时候报错
* Handle a login request to the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/publicfunctionlogin(Request $request){$this->validateLogin($request);// If the class is using the ThrottlesLogins trait, we can automatically throttle// the login attempts for this application. We'll key this by the username and// the IP address of the client making these requests into this application.if($this->hasTooManyLoginAttempts($request)){$this->fireLockoutEvent($request);return$this->sendLockoutResponse($request);}if($this->attemptLogin($request)){flash('欢迎回来!')->success();return$this->sendLoginResponse($request);}// If the login attempt was unsuccessful we will increment the number of attempts// to login and redirect the user back to the login form. Of course, when this// user surpasses their maximum number of attempts they will get locked out.$this->incrementLoginAttempts($request);return$this->sendFailedLoginResponse($request);}/**
* Determine if the user has too many failed login attempts.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/protectedfunctionhasTooManyLoginAttempts(Request $request){return$this->limiter()->tooManyAttempts($this->throttleKey($request),$this->maxAttempts(),$this->decayMinutes());}/**
* Get the throttle key for the given request.
*
* @param \Illuminate\Http\Request $request
* @return string
*/protectedfunctionthrottleKey(Request $request){return Str::lower($request->input($this->username())).'|'.$request->ip();}/**
* Get the maximum number of attempts to allow.
*
* @return int
*/publicfunctionmaxAttempts(){returnproperty_exists($this,'maxAttempts')?$this->maxAttempts:5;}/**
* Get the number of minutes to throttle for.
*
* @return int
*/publicfunctiondecayMinutes(){returnproperty_exists($this,'decayMinutes')?$this->decayMinutes:1;}/**
* Increment the login attempts for the user.
*
* @param \Illuminate\Http\Request $request
* @return void
*/protectedfunctionincrementLoginAttempts(Request $request){$this->limiter()->hit($this->throttleKey($request),$this->decayMinutes());}