$customer->invoice_company, 'tax_code' => $customer->tax_code, 'invoice_address' => $customer->invoice_address, 'invoice_email' => $customer->invoice_email, ]; } public static function save(Customer $customer, array $input): array { $customer->update(array_map( fn ($value) => is_string($value) && trim($value) === '' ? null : $value, array_intersect_key($input, array_flip(self::FIELDS)) + array_fill_keys(self::FIELDS, null), )); return self::payload($customer->fresh()); } }