protected function throttle(Exception $exception)
    {
        // if throttling is turned off or its in the dont throttle list we won't throttle this exception
        if (config('laravelEmailExceptions.ErrorEmail.throttle') == false ||
            $this->isInDontThrottleList($exception)
        ) {
            // report that we do not need to throttle
            return false;
        } else {
            // else lets check if its been reported within the last throttle period
            if (Cache::store(
                config('laravelEmailExceptions.ErrorEmail.throttleCacheDriver')
            )->has($this->getThrottleCacheKey($exception))
            ) {
                // if its in the cache we need to throttle
                return true;
            } else {
                // its not in the cache lets add it to the cache
                Cache::store(
                    config('laravelEmailExceptions.ErrorEmail.throttleCacheDriver')
                )->put(
                    $this->getThrottleCacheKey($exception),
                    true,
                    $this->getDateTimeMinutesFromNow(
                        config('laravelEmailExceptions.ErrorEmail.throttleDurationMinutes')
                    )
                );

                // report that we do not need to throttle as its not been reported within the last throttle period
                return false;
            }
        }
    }
protected function throttle(Exception $exception)
    {
        // if throttling is turned off or its in the dont throttle list we won't throttle this exception
        if (config('laravelEmailExceptions.ErrorEmail.throttle') == false ||
            $this->isInDontThrottleList($exception)
        ) {
            // report that we do not need to throttle
            return false;
        } else {
            // else lets check if its been reported within the last throttle period
            if (Cache::store(
                config('laravelEmailExceptions.ErrorEmail.throttleCacheDriver')
            )->has($this->getThrottleCacheKey($exception))
            ) {
                // if its in the cache we need to throttle
                return true;
            } else {
                // its not in the cache lets add it to the cache
                Cache::store(
                    config('laravelEmailExceptions.ErrorEmail.throttleCacheDriver')
                )->put(
                    $this->getThrottleCacheKey($exception),
                    true,
                    $this->getDateTimeMinutesFromNow(
                        config('laravelEmailExceptions.ErrorEmail.throttleDurationMinutes')
                    )
                );

                // report that we do not need to throttle as its not been reported within the last throttle period
                return false;
            }
        }
    }
protected function throttle ( Exception $ exception ) { // if throttling is turned off or its in the dont throttle list we won't throttle this exception if ( config ( 'laravelEmailExceptions.ErrorEmail.throttle' ) == false || $ this -> isInDontThrottleList ( $ exception ) ) { // report that we do not need to throttle return false ; } else { // else lets check if its been reported within the last throttle period if ( Cache :: store ( config ( 'laravelEmailExceptions.ErrorEmail.throttleCacheDriver' ) ) -> has ( $ this -> getThrottleCacheKey ( $ exception ) ) ) { // if its in the cache we need to throttle return true ; } else { // its not in the cache lets add it to the cache Cache :: store ( config ( 'laravelEmailExceptions.ErrorEmail.throttleCacheDriver' ) ) -> put ( $ this -> getThrottleCacheKey ( $ exception ) , true , $ this -> getDateTimeMinutesFromNow ( config ( 'laravelEmailExceptions.ErrorEmail.throttleDurationMinutes' ) ) ) ; // report that we do not need to throttle as its not been reported within the last throttle period return false ; } } }
check if we need to throttle the exception and do the throttling if required

@param Exception $exception
@return bool
@throws Exception
check if we need to throttle the exception and do the throttling if required