A comprehensive Laravel package for fetching Brazilian zip code (CEP) information from multiple providers, offering seamless caching and flexibility.
- Multiple Providers: Integrates with:
- Intelligent Caching: Streamlines performance with optional Redis caching.
- Ease of Use: Simple interface via container or facade.
- Customizable: Configure the preferred provider.
composer require gabrielmoura/laravel-cep
Publish the configuration file (optional):
php artisan vendor:publish --provider="Gabrielmoura\LaravelCep\CepServiceProvider"
In your config/services.php
, adjust the default provider if desired:
'cep' => [
'endpoint' => \Gabrielmoura\LaravelCep\EndpointOption::POSTMON, // Example: Change to your preferred provider
],
Strongly consider installing illuminate/redis
for automatic caching.
Container:
use Gabrielmoura\LaravelCep\CepService;
$cepData = app(CepService::class)->find('01001000', true); // Enable caching
Facade:
use Gabrielmoura\LaravelCep\Cep;
$cepData = Cep::find('01001000', true); // Enable caching
- Laravel 10.x
We welcome contributions! Please refer to our CONTRIBUTING.md
Laravel CEP is released under the MIT License.