celsonery/laravel-viacep

A little Laravel package for integration with viacep api.

Maintainers

Package info

github.com/celsonery/laravel-viacep

pkg:composer/celsonery/laravel-viacep

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-04-30 14:44 UTC

This package is auto-updated.

Last update: 2026-04-30 14:45:03 UTC


README

A little package utility to work with ViaCep web service

Maintainer Latest Version on Packagist Software License GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.