API reference / Quittio \ Laravel \ Jobs
RenderInvoice
final class in quittio/laravel · implements Illuminate\Contracts\Queue\ShouldQueue · uses Illuminate\Queue\InteractsWithQueue, Illuminate\Bus\Queueable
Quittio\Laravel\Jobs\RenderInvoice · Source
Renders an invoice in the queue and stores the main output on a disk.
The invoice travels as JSON snapshot with its version, so jobs queued before an update of the data model are brought up to date by the configured upcasters; the render options travel as versioned JSON as well (RenderOptions::toArray()). Errors that another attempt cannot fix (validation, invalid data, configuration) fail the job at once; others, e.g. a disk that is not reachable, are retried.
Constants#
| Constant | Value | Description |
|---|---|---|
PERMANENT_ERRORS | [\Quittio\Core\Validation\ValidationException::class, \Quittio\Core\Exceptions\InvalidInvoiceData::class, \Quittio\Core\Calculation\CalculationException::class, … | Exceptions that fail the job without a further attempt. |
Properties#
| Property | Type | Description |
|---|---|---|
$backoff | list<int> | |
$disk readonly | ?string | |
$invoice readonly | string | |
$options | RenderOptions|string | JSON of RenderOptions::toArray(); a RenderOptions object in jobs queued by Quittio 0.1.0. |
$path readonly | ?string | |
$tries | int |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->data() | |
->failed() | Called by the queue worker when the job failed for good. |
->handle() | |
->middleware() | |
->renderOptions() |
__construct()#
public function __construct(
string $invoice,
RenderOptions|string $options,
?string $disk = null,
?string $path = null,
)| Parameter | Type | Description |
|---|---|---|
$invoice | string | |
$options | RenderOptions|string | |
$disk | ?string = null | |
$path | ?string = null |
data()#
public function data(?SnapshotUpcasterChain $upcasters = null): InvoiceData| Parameter | Type | Description |
|---|---|---|
$upcasters | ?SnapshotUpcasterChain = null |
- Returns
InvoiceData
failed()#
public function failed(Throwable $exception): voidCalled by the queue worker when the job failed for good.
| Parameter | Type | Description |
|---|---|---|
$exception | Throwable |
handle()#
public function handle(
QuittioManager $quittio,
?SnapshotUpcasterChain $upcasters = null,
): void| Parameter | Type | Description |
|---|---|---|
$quittio | QuittioManager | |
$upcasters | ?SnapshotUpcasterChain = null |
middleware()#
public function middleware(): list<object>- Returns
list<object>
renderOptions()#
public function renderOptions(): RenderOptions- Returns
RenderOptions