2017 © Pedro Peláez
 

library viacep-php

ViaCEP PHP SDK

image

flyingluscas/viacep-php

ViaCEP PHP SDK

  • Friday, July 6, 2018
  • by FlyingLuscas
  • Repository
  • 3 Watchers
  • 23 Stars
  • 3,030 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 5 Versions
  • 23 % Grown

The README.md

ViaCEP PHP SDK

Latest Version on Packagist ![CircleCI][icon-circleci] Codecov ![Software License][ico-license] Total Downloads, (*1)

Search for addresses by zip code using the ViaCEP REST API., (*2)

Install

Via Composer, (*3)

``` bash $ composer require flyingluscas/viacep-php, (*4)


## Usage ### findByZipCode Find address by zip code. ```php use FlyingLuscas\ViaCEP\ViaCEP; $viacep = new ViaCEP; $address = $viacep->findByZipCode('01001-000')->toArray(); /* Should return something like this: [ 'zipCode' => '01001-000', 'street' => 'Praça da Sé', 'complement' => 'lado ímpar', 'neighborhood' => 'Sé', 'city' => 'São Paulo', 'state' => 'SP', 'ibge' => '3550308', ] */ $address = $viacep->findByZipCode('01001-000')->toJson(); /* Should return something like this: { "zipCode": "01001-000", "street": "Praça da Sé", "complement": "lado ímpar", "neighborhood": "Sé", "city": "São Paulo", "state": "SP", "ibge": "3550308" } */

findByStreetName

Search for addresses using state, city and a street name., (*5)

use FlyingLuscas\ViaCEP\ViaCEP;

$viacep = new ViaCEP;

$addresses = $viacep->findByStreetName('SP', 'São Paulo', 'Gomes de Carvalho');

/*
Should return something like this:

[
    [
        'zipCode' => '01001-000',
        'street' => 'Praça da Sé',
        'complement' => 'lado ímpar',
        'neighborhood' => 'Sé',
        'city' => 'São Paulo',
        'state' => 'SP',
        'ibge' => '3550308',
    ],
    [
        'zipCode' => '01001-000',
        'street' => 'Praça da Sé',
        'complement' => 'lado ímpar',
        'neighborhood' => 'Sé',
        'city' => 'São Paulo',
        'state' => 'SP',
        'ibge' => '3550308',
    ]
]
*/

Change log

Please see CHANGELOG for more information what has changed recently., (*6)

Testing

bash $ composer test, (*7)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*8)

Security

If you discover any security related issues, please email lucas.pires.mattos@gmail.com instead of using the issue tracker., (*9)

Credits

License

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

The Versions

06/07 2018

dev-master

9999999-dev https://github.com/flyingluscas/viacep-php

ViaCEP PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

address brazil cep viacep zipcode flyingluscas enderecos

06/07 2018

dev-integrations

dev-integrations https://github.com/flyingluscas/viacep-php

ViaCEP PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

address brazil cep viacep zipcode flyingluscas enderecos

06/07 2018

dev-circleci

dev-circleci https://github.com/flyingluscas/viacep-php

ViaCEP PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

address brazil cep viacep zipcode flyingluscas enderecos

23/09 2017

v1.0.1

1.0.1.0 https://github.com/flyingluscas/viacep-php

ViaCEP PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

address brazil cep viacep zipcode flyingluscas enderecos

11/11 2016

v1.0.0

1.0.0.0 https://github.com/flyingluscas/viacep-php

ViaCEP PHP SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

address brazil cep viacep zipcode flyingluscas enderecos