API reference / Quittio \ Laravel \ Jobs
RenderDocument
final class in quittio/laravel · implements Illuminate\Contracts\Queue\ShouldQueue · uses Illuminate\Queue\InteractsWithQueue, Illuminate\Bus\Queueable
Quittio\Laravel\Jobs\RenderDocument · Source
Renders a quote, delivery note, reminder or other document in the queue and stores it on a disk. The document travels as versioned JSON snapshot (DocumentData::toSnapshot(), brought up to date by quittio.snapshots.document_upcasters), the render options as versioned JSON. Errors that another attempt cannot fix fail the job at once; others are retried.
Constants#
| Constant | Value | Description |
|---|---|---|
PERMANENT_ERRORS | [\Quittio\Core\Calculation\CalculationException::class, \Quittio\Core\Exceptions\ConfigurationException::class, \Quittio\Core\Exceptions\HydrationException::cla … | Exceptions that fail the job without a further attempt. |
Properties#
| Property | Type | Description |
|---|---|---|
$backoff | list<int> | |
$disk readonly | ?string | |
$document readonly | string | JSON of DocumentData::toSnapshot() |
$options readonly | string | JSON of RenderOptions::toArray() |
$path readonly | ?string | |
$tries | int |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->data() | The document of the job, upcast with the document upcasters of the application. |
->failed() | Called by the queue worker when the job failed for good. |
->handle() | Renders the document with the events of a render run, stores it and dispatches QueuedDocumentStored. |
->middleware() | |
::of() | The job of a document and its render options. |
->renderOptions() | The render options of the job. |
__construct()#
public function __construct(
string $document,
string $options,
?string $disk = null,
?string $path = null,
)| Parameter | Type | Description |
|---|---|---|
$document | string | JSON of DocumentData::toSnapshot() |
$options | string | JSON of RenderOptions::toArray() |
$disk | ?string = null | |
$path | ?string = null |
data()#
public function data(): DocumentDataThe document of the job, upcast with the document upcasters of the application.
- Returns
DocumentData- Throws
JsonException|HydrationException|SnapshotVersionException– for a payload that cannot be read
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): voidRenders the document with the events of a render run, stores it and dispatches QueuedDocumentStored.
| Parameter | Type | Description |
|---|---|---|
$quittio | QuittioManager |
middleware()#
public function middleware(): list<object>- Returns
list<object>
of()#
public static function of(
DocumentData $document,
RenderOptions $options,
?string $disk = null,
?string $path = null,
): selfThe job of a document and its render options.
| Parameter | Type | Description |
|---|---|---|
$document | DocumentData | |
$options | RenderOptions | |
$disk | ?string = null | |
$path | ?string = null |
- Returns
self
renderOptions()#
public function renderOptions(): RenderOptionsThe render options of the job.
- Returns
RenderOptions- Throws
JsonException– for a payload that cannot be read