tax_report = isset($attributes['tax_report']) ? new TaxReport($attributes['tax_report']) : new TaxReport([]); } /** * Get the name of the caster class to use when casting from / to this cast target. * * @param array $arguments */ public static function castUsing(array $arguments): string { return TransactionEventMetadataCast::class; } public static function fromArray(array $data): self { return new self($data); } public function toArray(): array { return [ 'tax_report' => $this->tax_report->toArray(), ]; } }