Address Info Getter - Pesquisas de informações de endereços

1.3 2021-11-03 13:43 UTC

This package is auto-updated.

Last update: 2024-12-29 06:28:06 UTC


README

License: MIT

Goldbach Algorithms Address Info Getter (fondly nicknamed AIG) is a PHP library developed for Symfony to collect address information.

Installation

Use the composer to install:

composer require goldbach-algorithms/aig

Usage

Create an AIG instance and look for the address indicating or not the source of access.

# Add use AIG
use GoldbachAlgorithms\AIG\AIG;

# create a new AIG
$aig = new AIG();

# get address by CEP
$aig->getAddressByCep('89566410');

# get address by cep using a specific source
$aig->getAddressByCep('89304258', AIG::SOURCE_CORREIOS);
$aig->getAddressByCep('89304258', AIG::SOURCE_VIACEP);

Return

Look at an example of a JSON return displaying the source of the information.

{
  "zipCode": "89304258",
  "street": "Rua Pioneiro Arlindo Goldbach",
  "complement": "",
  "neighborhood": "Vila Nova",
  "city": "Mafra",
  "state": "SC",
  "source": "Correios"
}

License

MIT

Copyright © 2021 Goldbach Algorithms