diff --git a/src/Illuminate/Queue/InteractsWithQueue.php b/src/Illuminate/Queue/InteractsWithQueue.php index bf1e021a5ef8..13b51df8f8d2 100644 --- a/src/Illuminate/Queue/InteractsWithQueue.php +++ b/src/Illuminate/Queue/InteractsWithQueue.php @@ -13,6 +13,16 @@ trait InteractsWithQueue */ protected $job; + /** + * Get the number of times the job has been attempted. + * + * @return int + */ + public function attempts() + { + return $this->job ? $this->job->attempts() : 1; + } + /** * Delete the job from the queue. * @@ -26,26 +36,28 @@ public function delete() } /** - * Release the job back into the queue. + * Fail the job from the queue. * - * @param int $delay * @return void */ - public function release($delay = 0) + public function failed() { if ($this->job) { - return $this->job->release($delay); + return $this->job->failed(); } } /** - * Get the number of times the job has been attempted. + * Release the job back into the queue. * - * @return int + * @param int $delay + * @return void */ - public function attempts() + public function release($delay = 0) { - return $this->job ? $this->job->attempts() : 1; + if ($this->job) { + return $this->job->release($delay); + } } /**