class Illuminate / Queue / Middleware / ThrottlesExceptions
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

ThrottlesExceptions

Properties

protected

$key string

The developer specified key that the rate limiter should use.

Default: null
protected

$byJob bool

Indicates whether the throttle key should use the job's UUID.

Default: false
protected

$maxAttempts int

The maximum number of attempts allowed before rate limiting applies.

Default: null
protected

$decayMinutes int

The number of minutes until the maximum attempts are reset.

Default: null
protected

$retryAfterMinutes int

The number of minutes to wait before retrying the job after an exception.

protected

$whenCallback callable

The callback that determines if rate limiting should apply.

Default: null
protected

$prefix string

The prefix of the rate limiter key.

Default: 'laravel_throttles_exceptions:'
protected

$limiter RateLimiter

The rate limiter instance.

Default: null

Methods

public

__construct ( $maxAttempts , $decayMinutes ) : void

Create a new middleware instance.

Parameters

  • $maxAttempts int
  • $decayMinutes int
public

handle ( $job , $next ) : mixed

Process the job.

Parameters

  • $job mixed
  • $next callable
public

when ( callable $callback ) : $this

Specify a callback that should determine if rate limiting behavior should apply.

Parameters

  • $callback callable
public

withPrefix ( string $prefix ) : $this

Set the prefix of the rate limiter key.

Parameters

  • $prefix string
public

backoff ( $backoff ) : $this

Specify the number of minutes a job should be delayed when it is released (before it has reached its max exceptions).

Parameters

  • $backoff int
protected

getKey ( $job ) : string

Get the cache key associated for the rate limiter.

Parameters

  • $job mixed
public

by ( $key ) : $this

Set the value that the rate limiter should be keyed by.

Parameters

  • $key string
public

byJob ( ) : $this

Indicate that the throttle key should use the job's UUID.

protected

getTimeUntilNextRetry ( $key ) : int

Get the number of seconds that should elapse before the job is retried.

Parameters

  • $key string