Simple zip code consult with ViaCEP.
1.1
2023-09-14 20:04 UTC
Requires
- php: ^8.1
Requires (Dev)
- pestphp/pest: ^2.18
README
Installation | Technologies | Using | Tests
Project
Simple class for zip code query in the ViaCEP public API.
Classe simples para consulta de CEP na api publica do ViaCEP.
Installation
By Composer
Via Composer
composer require paradisesessions/cep
Technologies
Using
Example of use for a simple query.
Exemplo de uso para uma simples consulta.
$cep = new \ParadiseSessions\Cep\Cep(); if (!$cep->consult('04538133')) { exit($cep->fail()->getMessage()); } var_dump($cep->data()); echo "<p>Address: {$cep->address} {$cep->complement}, {$cep->city} - {$cep->state}</p>"; echo "<p>Zip code: {$cep->format()}";
*you can pass the formatted zip code and it will work.
Pode passar o CEP formatado que funcionará.
Tests
Test class with Pest.
Testes na classe realizados com Pest.
composer test