protected function safeHandle(Request $request, Closure $next, int $limit, $decay, bool $global, bool $headers)
    {
        if ($this->shouldPassThrough($request)) {
            return $next($request);
        }

        $key = $global ? sha1($request->ip()) : $request->fingerprint();

        if ($this->limiter->tooManyAttempts($key, $limit, $decay)) {
            throw $this->buildException($key, $limit, $headers);
        }

        $this->limiter->hit($key, $decay);

        $response = $next($request);

        $response->headers->add($this->getHeaders($key, $limit, $headers));

        return $response;
    }
protected function safeHandle(Request $request, Closure $next, int $limit, $decay, bool $global, bool $headers)
    {
        if ($this->shouldPassThrough($request)) {
            return $next($request);
        }

        $key = $global ? sha1($request->ip()) : $request->fingerprint();

        if ($this->limiter->tooManyAttempts($key, $limit, $decay)) {
            throw $this->buildException($key, $limit, $headers);
        }

        $this->limiter->hit($key, $decay);

        $response = $next($request);

        $response->headers->add($this->getHeaders($key, $limit, $headers));

        return $response;
    }
protected function safeHandle ( Request $ request , Closure $ next , int $ limit , $ decay , bool $ global , bool $ headers ) { if ( $ this -> shouldPassThrough ( $ request ) ) { return $ next ( $ request ) ; } $ key = $ global ? sha1 ( $ request -> ip ( ) ) : $ request -> fingerprint ( ) ; if ( $ this -> limiter -> tooManyAttempts ( $ key , $ limit , $ decay ) ) { throw $ this -> buildException ( $ key , $ limit , $ headers ) ; } $ this -> limiter -> hit ( $ key , $ decay ) ; $ response = $ next ( $ request ) ; $ response -> headers -> add ( $ this -> getHeaders ( $ key , $ limit , $ headers ) ) ; return $ response ; }
Handle an incoming request, with correct types.

@param \Illuminate\Http\Request $request
@param \Closure                 $next
@param int                      $limit
@param int|float                $decay
@param bool                     $global
@param bool                     $headers

@throws \AltThree\Throttle\ThrottlingException

@return mixed
Handle an incoming request with correct types .