celsonery / laravel-viacep
A little Laravel package for integration with viacep api.
1.0.0
2026-04-30 14:44 UTC
Requires
- php: ^8.2
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.29
- orchestra/testbench: ^11.1
- pestphp/pest: ^4.6
- pestphp/pest-plugin-laravel: ^4.1
README
A little package utility to work with ViaCep web service
Installation
You can install the package via composer:
composer require celsonery/viacep
You can publish the config file with:
php artisan viacep:install
or
php artisan vendor:publish --tag="viacep-config"
This is the contents of the published config file:
return [ base_url => env('BASE_URL', 'https://viacep.com.br/ws') ];
Usage
- Via Facade
use CelsoNery\ViaCep\Facades\BrasilApi; $response = ViaCep::get('00100001'); return $response;
- Via DI
use Celso\ViaCep\ViaCepService; public function index(ViaCepService $viaCep) { return $viaCep->get('00100001'); }
Testing
composer tests
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.