From 16b3e0dd173c3c5d46f49da7685b14c32e907499 Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:42:45 -0300 Subject: [PATCH 01/11] refactor: Renderiza o dashboard geral. --- app/Http/Controllers/ClientController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index b0b7571..8a93347 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -13,7 +13,6 @@ class ClientController extends Controller public function __construct(ClientService $userService) {} public function dashboard(Request $request): View { - $clients = Client::all(); - return view('dashboard', ['clients' => $clients]); + return view('dashboard'); } } From 73bc3598856ebf215b03120c6aaf88d85d65b325 Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:45:29 -0300 Subject: [PATCH 02/11] =?UTF-8?q?Sem=20mudan=C3=A7as.?= 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 2808a57..99f8b74 100644 --- a/app/Livewire/Admin/AddClient.php +++ b/app/Livewire/Admin/AddClient.php @@ -5,6 +5,7 @@ use App\Models\Client; use App\Services\ClientService; use App\Livewire\Forms\ClientForm; // 1. Importa seu Form Object +use Illuminate\Support\Facades\Auth; use Livewire\Component; use Livewire\WithFileUploads; use Illuminate\Support\Facades\Crypt; From a7b0de06f18ad381990f9e8248455c310b6d51d4 Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:45:54 -0300 Subject: [PATCH 03/11] =?UTF-8?q?Sem=20mudan=C3=A7as.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Forms/ClientForm.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Livewire/Forms/ClientForm.php b/app/Livewire/Forms/ClientForm.php index e6f4801..0f04d91 100644 --- a/app/Livewire/Forms/ClientForm.php +++ b/app/Livewire/Forms/ClientForm.php @@ -8,7 +8,6 @@ class ClientForm extends Form { - // 2. ATRIBUTOS REMOVIDOS: Os #[Rule(...)] foram removidos daqui public $client_name = ''; public $legal_name = ''; public $cnpj = ''; From c788a80d0381cbb476eb0cbc46fb55aa78b5a24a Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:47:22 -0300 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20Agora=20verifica=20se=20o=20usu?= =?UTF-8?q?=C3=A1rio=20est=C3=A1=20logado=20antes=20de=20concluir=20uma=20?= =?UTF-8?q?a=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ClientService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/ClientService.php b/app/Services/ClientService.php index 4ed0af6..8368323 100644 --- a/app/Services/ClientService.php +++ b/app/Services/ClientService.php @@ -4,6 +4,7 @@ use App\Models\Client; use App\Models\User; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Gate; class ClientService @@ -12,6 +13,10 @@ class ClientService public function __construct(protected Client $client) {} public function addClient(array $client) { + if (!Auth::check()) { + return redirect()->to('/login'); + } + return Client::create($client); } } From 4afc2b4e0a95929747bfa3be380e6a07eb740166 Mon Sep 17 00:00:00 2001 From: lukibeg Date: Sun, 16 Nov 2025 21:48:26 -0300 Subject: [PATCH 05/11] =?UTF-8?q?refactor|feat:=20Aprimora=20transi=C3=A7?= =?UTF-8?q?=C3=B5es=20e=20apaga=20cliente=20de=20forma=20permanente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/are-you-sure.blade.php | 62 +++++++------------ 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/resources/views/components/are-you-sure.blade.php b/resources/views/components/are-you-sure.blade.php index b6d0c6e..629159c 100644 --- a/resources/views/components/are-you-sure.blade.php +++ b/resources/views/components/are-you-sure.blade.php @@ -3,42 +3,35 @@ - 'showQuestion' controla a visibilidade. - '@sure.window' é o evento que dispara a abertura. --> -
+
-