From 930010fb82446ca06e9f1a7105ec39fe2b1bcefa Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 12:44:29 -0300 Subject: [PATCH 01/12] =?UTF-8?q?Sem=20mudan=C3=A7os.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Admin/AddClient.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Livewire/Admin/AddClient.php b/app/Livewire/Admin/AddClient.php index 99f8b74..e3453f7 100644 --- a/app/Livewire/Admin/AddClient.php +++ b/app/Livewire/Admin/AddClient.php @@ -41,6 +41,7 @@ public function save(ClientService $clientService) } } + public function render() { return view('livewire.admin.add-client'); From 47eeaa59be0fcec86ffda697c0bab9d3155fc15a Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 12:45:23 -0300 Subject: [PATCH 02/12] refactor: Escuta evento para quando cliente foi adicionado. --- app/Livewire/Admin/ShowClient.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Livewire/Admin/ShowClient.php b/app/Livewire/Admin/ShowClient.php index bc522bb..740c13a 100644 --- a/app/Livewire/Admin/ShowClient.php +++ b/app/Livewire/Admin/ShowClient.php @@ -10,6 +10,7 @@ class ShowClient extends Component { #[On('clientDeleted')] + #[On('client-added')] public function refreshClientList() {} public function render() From 7fce28174eab1b882d1caf5b8ea8413c48c519c4 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:19:23 -0300 Subject: [PATCH 03/12] =?UTF-8?q?refactor:=20Obt=C3=A9m=20cliente=20criado?= =?UTF-8?q?=20e=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'); } From 4fdc598acaaded8d843d59830fd94fb8da7c09a9 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:22:02 -0300 Subject: [PATCH 04/12] =?UTF-8?q?feat:=20Inclui=20o=20m=C3=A9todo=20update?= =?UTF-8?q?Client=20e=20utiliza=C3=A7=C3=A3o=20do=20service=20par=20realiz?= =?UTF-8?q?ar=20as=20a=C3=A7=C3=B5es.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Forms/ClientForm.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Livewire/Forms/ClientForm.php b/app/Livewire/Forms/ClientForm.php index 0f04d91..416241e 100644 --- a/app/Livewire/Forms/ClientForm.php +++ b/app/Livewire/Forms/ClientForm.php @@ -2,6 +2,8 @@ namespace App\Livewire\Forms; +use App\Services\ClientService; +use Exception; use Livewire\Attributes\Validate; use Livewire\Form; use App\Models\Client; @@ -24,6 +26,7 @@ class ClientForm extends Form public $modules = ''; public $whatsapp_number = ''; public $whatsapp_activation_date; + public ClientService $clientService; // Método para preencher o formulário (para edição futura) public function addClient(Client $client) @@ -32,10 +35,19 @@ public function addClient(Client $client) $data['has_call_center'] = (bool) $client->has_call_center; $data['has_voice_gateway'] = (bool) $client->has_voice_gateway; $data['has_fop2'] = (bool) $client->has_fop2; + $data['client_name'] = $data['name']; $this->fill($data); } + public function updateClient(Client $client) + { + if(!$this->clientService->updateClient($client)){ + throw new Exception('Ocorreu um erro.'); + } + + + } // 4. ADICIONADO: Método de Regras /** * Define as regras de validação para o formulário. From eecb51f521e443cec29e2fde91269d76dcd67a3c Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:22:46 -0300 Subject: [PATCH 05/12] =?UTF-8?q?feat:=20Inicia=20constru=C3=A7=C3=A3o=20d?= =?UTF-8?q?a=20fun=C3=A7=C3=A3o=20updateClient.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ClientService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/ClientService.php b/app/Services/ClientService.php index 8368323..2d713af 100644 --- a/app/Services/ClientService.php +++ b/app/Services/ClientService.php @@ -19,4 +19,6 @@ public function addClient(array $client) return Client::create($client); } + + public function updateClient($client) {} } From 54e7be3f8f4b86318378035649082efeffb99174 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:23:21 -0300 Subject: [PATCH 06/12] =?UTF-8?q?feat:=20Altera=C3=A7=C3=B5es=20visuais?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/css/app.css | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 8413264..9823b0e 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -144,44 +144,20 @@ @layer components { @apply transition-colors; } - /* 9. Estilizando as mensagens de erro (x-session-messages) */ - .messages { - @apply flex justify-center mb-4; - } - .messages div[role="alert"] { /* Assumindo que seu componente renderiza um div */ @apply bg-red-500/50 text-white p-3 rounded-md border border-red-700 text-sm; } - /* --- FIM DOS ESTILOS DE LOGIN --- */ - - /* 9. Estilizando as mensagens de erro (x-session-messages) */ .messages { @apply flex justify-center mb-4; - - /* 1. MUDANÇA: Usando "vidro branco" (como o card) - em vez de "vidro vermelho". - */ @apply bg-white/10 backdrop-blur-md; - /* 'md' para um borrão mais forte */ - - /* 2. MUDANÇA: Borda sutil de "vidro" */ @apply border border-white/10; - - /* 3. NOVO: Sombra para "flutuar" */ @apply shadow-lg rounded-lg; - - /* 4. MUDANÇA: A cor do erro agora está no texto. - 'text-red-200' (ou 300) tem ótimo contraste - no fundo de ondas. - */ @apply text-red-300 font-semibold p-4 text-sm; } - /* Classes antigas genéricas (podem ser usadas em outros lugares) */ .container { - /* Deixe APENAS as classes de largura, margem e padding */ @apply w-full mx-auto px-4 sm:px-6 lg:px-8 mt-15 mb-10; } From 6eda77e44a595a3936c721c30df5b077da15c74a Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:24:14 -0300 Subject: [PATCH 07/12] =?UTF-8?q?feat:=20Altera=C3=A7=C3=B5es=20visuais.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/components/are-you-sure.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/components/are-you-sure.blade.php b/resources/views/components/are-you-sure.blade.php index 629159c..8d662d7 100644 --- a/resources/views/components/are-you-sure.blade.php +++ b/resources/views/components/are-you-sure.blade.php @@ -35,7 +35,7 @@ class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded- -
+
From ba67fddf1ba672205c194f6e0e240897bc10226d Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:25:07 -0300 Subject: [PATCH 08/12] refactor: Exibe mensagens de erro. --- resources/views/components/session-messages.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/components/session-messages.blade.php b/resources/views/components/session-messages.blade.php index 588992d..d7dab76 100644 --- a/resources/views/components/session-messages.blade.php +++ b/resources/views/components/session-messages.blade.php @@ -1,10 +1,10 @@
-
- {{-- 1. O @if garante que este bloco (incluindo o 'div') só será renderizado se houver um erro. --}} - @if ($errors->any() || session('error')) + {{-- 1. O @if garante que este bloco (incluindo o 'div') só será renderizado se houver um erro. --}} + @if ($errors->any() || session('error')) +
{{-- 2. Adicionamos o 'role="alert"'. O seu CSS (em .messages div[role="alert"]) agora vai aplicar o estilo "vidro vermelho" aqui. --}} @if ($errors->any()) {{ $errors->first() }} @endif @if (session('error')) {{ session('error') }} @endif - @endif
+ @endif
\ No newline at end of file From fe96cddbfd87091e021da218624ffe8ad5fb10e8 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:25:21 -0300 Subject: [PATCH 09/12] =?UTF-8?q?Sem=20mudan=C3=A7as.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/dashboard.blade.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index fc02b3b..bcb97c6 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -2,10 +2,11 @@ @yield('title', 'Nexus - Dashboard') @section('content') - - - - - - + + + + + + + @endsection \ No newline at end of file From 013f22ccee3ea091531b1b228292cf41233dd067 Mon Sep 17 00:00:00 2001 From: LukiBeg Date: Mon, 17 Nov 2025 17:25:49 -0300 Subject: [PATCH 10/12] =?UTF-8?q?feat:=20Inclui=20novo=20recurso=20para=20?= =?UTF-8?q?edi=C3=A7=C3=A3o=20do=20cliente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/livewire/admin/show-client.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/admin/show-client.blade.php b/resources/views/livewire/admin/show-client.blade.php index c506763..b75f38c 100644 --- a/resources/views/livewire/admin/show-client.blade.php +++ b/resources/views/livewire/admin/show-client.blade.php @@ -19,7 +19,7 @@ class="w-32 h-32 rounded-full object-cover">