client = Client::find($id); if ($this->client) { $this->clientForm->addClient($this->client); } } catch (Exception $e) { $this->dispatch('notify', message: 'Ocorreu um erro inesperado ao editar o cliente. ' + $e); } } public function edit($clientId) { $this->clientForm->validate(); try { $this->clientForm->updateClient($this->client); $this->dispatch('notify', message: $this->client->client_name + ' atualizado com sucesso!'); } catch (Exception $e) { $this->dispatch('notify', message: 'Ocorreu um erro inesperado ao tentar confirmar edição do cliente. ' + $e); } } public function render() { return view('livewire.admin.edit-client'); } }