29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Queues 325<br />

.<br />

18 *<br />

19 * @param Mailer $mailer<br />

20 * @return void<br />

21 */<br />

22 public function handle(Mailer $mailer)<br />

23 {<br />

24 //<br />

25 }<br />

26<br />

27 /**<br />

28 * Handle a job failure.<br />

29 *<br />

30 * @return void<br />

31 */<br />

32 public function failed()<br />

33 {<br />

34 // Called when the job is failing...<br />

35 }<br />

36 }<br />

Retrying Failed Jobs<br />

To view all of your failed jobs that have been inserted into your failed_jobs database table, you<br />

may use the queue:failed Artisan command:<br />

.<br />

1 php artisan queue:failed<br />

The queue:failed command will list the job ID, connection, queue, and failure time. The job ID may<br />

be used to retry the failed job. For instance, to retry a failed job that has an ID of 5, the following<br />

command should be issued:<br />

.<br />

1 php artisan queue:retry 5<br />

If you would like to delete a failed job, you may use the queue:forget command:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!