From 19c595e396a40ebf47b238173c5d0111f1e7eac3 Mon Sep 17 00:00:00 2001 From: danielcei Date: Sun, 17 Mar 2024 14:33:49 -0300 Subject: [PATCH 1/3] Url ViaCep in .env --- config/filament-ptbr-form-fields.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/filament-ptbr-form-fields.php b/config/filament-ptbr-form-fields.php index 0b67a5f..1bb7834 100644 --- a/config/filament-ptbr-form-fields.php +++ b/config/filament-ptbr-form-fields.php @@ -1,3 +1,5 @@ env('VIACEP_URL', 'viacep.com.br/ws/'), +]; From ac08b651f0b43274d0615b5561b93870d8bf2467 Mon Sep 17 00:00:00 2001 From: danielcei Date: Sun, 17 Mar 2024 14:36:20 -0300 Subject: [PATCH 2/3] Update ViaCep url config --- src/Cep.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cep.php b/src/Cep.php index fbd9fbf..3d313e2 100755 --- a/src/Cep.php +++ b/src/Cep.php @@ -19,7 +19,7 @@ public function viaCep(string $mode = 'suffix', string $errorMessage = 'CEP inv $livewire->validateOnly($component->getKey()); - $request = Http::get("viacep.com.br/ws/$state/json/")->json(); + $request = Http::get(config("filament-ptbr-form-fields.viacep_url") . $state."/json/")->json(); foreach ($setFields as $key => $value) { $set($key, $request[$value] ?? null); From db08ca3a345caa95d3d78a3e36ebe3194a2c535f Mon Sep 17 00:00:00 2001 From: leandrocfe Date: Sat, 23 Mar 2024 00:07:35 +0000 Subject: [PATCH 3/3] Fix styling --- src/Cep.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cep.php b/src/Cep.php index 3d313e2..21d5c75 100755 --- a/src/Cep.php +++ b/src/Cep.php @@ -19,7 +19,7 @@ public function viaCep(string $mode = 'suffix', string $errorMessage = 'CEP inv $livewire->validateOnly($component->getKey()); - $request = Http::get(config("filament-ptbr-form-fields.viacep_url") . $state."/json/")->json(); + $request = Http::get(config('filament-ptbr-form-fields.viacep_url').$state.'/json/')->json(); foreach ($setFields as $key => $value) { $set($key, $request[$value] ?? null);