clientId) { $this->data['client_id'] = $this->clientId; if ($currencyCode = Client::find($this->clientId)?->currency_code) { $this->data['currency_code'] = $currencyCode; } } } public function getMaxContentWidth(): MaxWidth | string | null { return MaxWidth::Full; } protected function handleRecordCreation(array $data): Model { /** @var Invoice $record */ $record = parent::handleRecordCreation($data); $this->handleLineItems($record, collect($data['lineItems'] ?? [])); $totals = $this->updateDocumentTotals($record, $data); $record->updateQuietly($totals); return $record; } }