From 7fce28174eab1b882d1caf5b8ea8413c48c519c4 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:19:23 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20Obt=C3=A9m=20cliente=20criado=20e?= =?UTF-8?q?=20exibe=20nome=20na=20notifica=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Admin/AddClient.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Admin/AddClient.php b/app/Livewire/Admin/AddClient.php index e3453f7..22cf03f 100644 --- a/app/Livewire/Admin/AddClient.php +++ b/app/Livewire/Admin/AddClient.php @@ -24,7 +24,6 @@ public function save(ClientService $clientService) $data = $this->form->all(); $data['name'] = $data['client_name']; - if ($this->form->profile_image_path) { $path = $this->form->profile_image_path->store('client_logos', 'public'); $data['profile_image_path'] = $path; @@ -32,10 +31,10 @@ public function save(ClientService $clientService) $data['root_password'] = Crypt::encryptString($data['root_password']); - $clientService->addClient($data); + $client = $clientService->addClient($data); $this->dispatch('client-added'); - $this->dispatch('notify', message: 'Cliente adicionado com sucesso!'); + $this->dispatch('notify', message: $client->name . ' Cliente adicionado com sucesso!'); } catch (\Exception $e) { $this->dispatch('notify', message: 'Ocorreu um erro inesperado ao salvar.', type: 'error'); }