type->schema()->getSchema(); $this->resetValidation(); foreach ($formSchema as $key => $schema) { /** @var InputSchemaField $schema */ $schema = $schema->schema->getSchema(); if ($schema->dependsOn == $prop) { $this->detail[$key] = ''; } } $this->validateOnly($prop); } public function updatedType(): void { $this->reset('detail'); $schema = $this->type?->getSchema() ?? []; foreach ($schema as $value) { $this->detail[$value->key] = ''; } $this->resetValidation(); } public function rules(): array { return $this->type?->schema()?->getValidationRules('detail'); } public function validationAttributes(): array { return $this->type?->schema()?->getValidationAttributes('detail'); } public function toDto(): IssueInvoiceDTO { return new IssueInvoiceDTO( name: $this->name, clientRefId: $this->client_id, detail: $this->type->dtoTransform($this->detail), type: $this->type, status: InvoiceStatus::PENDING, amount: $this->amount, coaId: $this->coa_id, clientId: $this->client_id, ); } }