Skip to content

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#

ConstantValueDescription
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#

PropertyTypeDescription
$backofflist<int>
$disk readonly?string
$document readonlystringJSON of DocumentData::toSnapshot()
$options readonlystringJSON of RenderOptions::toArray()
$path readonly?string
$triesint

Methods#

MethodDescription
->__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,
)
ParameterTypeDescription
$documentstringJSON of DocumentData::toSnapshot()
$optionsstringJSON of RenderOptions::toArray()
$disk?string = null
$path?string = null

data()#

public function data(): DocumentData

The 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): void

Called by the queue worker when the job failed for good.

ParameterTypeDescription
$exceptionThrowable

handle()#

public function handle(QuittioManager $quittio): void

Renders the document with the events of a render run, stores it and dispatches QueuedDocumentStored.

ParameterTypeDescription
$quittioQuittioManager

middleware()#

public function middleware(): list<object>
Returns
list<object>

of()#

public static function of(
    DocumentData $document,
    RenderOptions $options,
    ?string $disk = null,
    ?string $path = null,
): self

static

The job of a document and its render options.

ParameterTypeDescription
$documentDocumentData
$optionsRenderOptions
$disk?string = null
$path?string = null
Returns
self

renderOptions()#

public function renderOptions(): RenderOptions

The render options of the job.

Returns
RenderOptions
Throws
JsonException – for a payload that cannot be read

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.