Skip to content

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#

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

PropertyTypeDescription
$backofflist<int>
$disk readonly?string
$invoice readonlystring
$optionsRenderOptions|stringJSON of RenderOptions::toArray(); a RenderOptions object in jobs queued by Quittio 0.1.0.
$path readonly?string
$triesint

Methods#

MethodDescription
->__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,
)
ParameterTypeDescription
$invoicestring
$optionsRenderOptions|string
$disk?string = null
$path?string = null

data()#

public function data(?SnapshotUpcasterChain $upcasters = null): InvoiceData
ParameterTypeDescription
$upcasters?SnapshotUpcasterChain = null
Returns
InvoiceData

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,
    ?SnapshotUpcasterChain $upcasters = null,
): void
ParameterTypeDescription
$quittioQuittioManager
$upcasters?SnapshotUpcasterChain = null

middleware()#

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

renderOptions()#

public function renderOptions(): RenderOptions
Returns
RenderOptions

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