Ticketing platform
From ticket purchase to entry control and follow-up: a web system with payments, invoicing, a mobile API and a community layer.
public function handle(): void
{
$order = Order::with(['billingAddress', 'user', 'items'])->find($this->orderId);
// On-site (POS) sales are invoiced through another flow and have no billing address.
if (Str::startsWith($order?->order_number ?? '', 'POS-')) {
return;
}
// What was actually paid is authoritative, not the list price of the items:
// a fully discounted order has total_amount = 0 and must not be invoiced.
if ((float) ($order?->total_amount ?? 0) <= 0) {
Log::info('Invoice skipped: order total is zero', ['order_id' => $this->orderId]);
return;
}
if (empty($order?->billingAddress)) {
Log::error('Invoice skipped: billing address is empty', ['order_id' => $this->orderId]);
return;
}
// ... build the invoice and hand it to the provider configured for this organiser
}