app/Jobs/FailJob.php
<?php
namespace App\Jobs;
use Exception;
use Illuminate\Bus\Batchable;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Moox\Jobs\Traits\JobProgress;
class FailJob implements ShouldQueue
{
use Batchable, Dispatchable, InteractsWithQueue, JobProgress, Queueable, SerializesModels;
public $tries;
public $timeout;
public $maxExceptions;
public $backoff;
public function __construct()
{
$this->tries = 10;
$this->timeout = 10;
$this->maxExceptions = 3;
$this->backoff = 20;
}
public function handle()
{
throw new Exception('This job is meant to fail.');
}
}