id = $id; $this->mode = 'update'; // $this->form->fill($this->model->only(['name'])); } #[Computed] public function invoiceSchema(): array { return $this->form ->type ?->schema() ->withContext([ 'faculty' => $this->form->detail['faculty'] ?? null, ]) ->withFormString('form.detail.') ->getSchema() ?? []; } public function save(InitializeInvoice $initializeInvoice): void { $this->form->validate(); $initializeInvoice->execute($this->form->toDto()); $this->dispatch('hide-invoice-form-modal'); $this->js("LaravelDataTables['invoice-table'].ajax.reload(null, false)"); } public function hide(): void { $this->form->reset(); $this->reset('id', 'mode'); $this->resetErrorBag(); } };