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/'), +]; diff --git a/src/Cep.php b/src/Cep.php index fbd9fbf..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("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);