$customer?->fullname ?? '', 'company' => $customer?->invoice_company ?: ($customer?->company ?? ''), 'tax_code' => $customer?->tax_code ?? '', 'address' => $customer?->invoice_address ?: ($customer?->address ?? ''), 'email' => $customer?->invoice_email ?: ($customer?->email ?? ''), ]; } public static function forInvoice(Invoice $invoice): array { return $invoice->buyer_snapshot ?: self::fromCustomer($invoice->customer); } }