cep/cep-brasil

使用此包,您可以免费进行CEP查询。基于jansenfelipe/cep-gratis,并加入了一些改进和修正,包括邮局和ViaCep的提供者

dev-master / 4.0.x-dev 2019-08-07 02:12 UTC

This package is auto-updated.

Last update: 2024-09-07 13:36:45 UTC


README

Latest Stable Version MIT license

该项目基于 https://github.com/jansenfelipe/cep-gratis 进行了一些改进。

变更:将CorreiosProvider更改为邮局的最新数据提供。ViaCepProvider被修改以处理viaCep的错误返回。

如何使用

添加库

$ composer require cep/cep-brasil

将composer的autoload.php文件添加到您的PHP文件中。

require_once 'vendor/autoload.php';

现在只需调用方法 CepGratis::search($cep)

use CepGratis\CepGratis;

$address = CepGratis::search('31030080');

许可证

MIT许可证 (MIT)