ozoriotsn/viacep

1.0.0 2024-01-05 12:54 UTC

This package is auto-updated.

Last update: 2024-09-05 14:35:56 UTC


README

Logo

VIACEP PHP SDK

Free webservice for search zip code address in all brazil locations

Latest Version on Packagist Software License

Installation

Composer install

composer require ozoriotsn/viacep

Usage

<?php
    require __DIR__ . '/vendor/autoload.php';
    
    use Ozoriotsn\ViaCep\ViaCep;

    $viacep = ViaCep::class;
    $zipCodeAddress = $viacep::findByCep('01001-000')->toJson();
    echo ($zipCodeAddress);

    /********************
     * Return address
     ********************
    {
    "cep": "01001-000",
    "logradouro": "Praça da Sé",
    "complemento": "lado Impar",
    "bairro": "Sé",
    "localidade": "São Paulo",
    "uf": "SP",
    "ibge": "3550308",
    "gia": "1004",
    "ddd": "11",
    "siafi": "7107",
    "fill": null
    }
    */

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

 ./vendor/bin/phpunit/ tests

Contributing

Please see CONTRIBUTING

License

The MIT License (MIT). Please see License File for more information.

Credits