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'); }