Xeridea
Xeridea

Reputation: 1136

Laravel Queue check max attempts

I need a Laravel job to check the max number of attempts the worker is set to try.

php artisan queue:listen --tries=3

This will try jobs 3 times. The only thing I can find in documentation for attempts is

$this->attempts()

This will tell me how many times the job has been attempted, but not the max attempts (from --tries=3). Is there a method to find out the max attempts?

Upvotes: 0

Views: 3007

Answers (1)

weotch
weotch

Reputation: 5878

Try $this->job->maxTries().

Upvotes: 2

Related Questions