Laravel Brasil API is a simple and elegant package to easily consume Brasil API endpoints within your Laravel applications.
- Installation
- Usage
- Examples
- Running Tests
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Requirements:
This package supports Laravel 8.0 and above.
Install the package via Composer:
composer require rafaellaurindo/laravel-brasilapi
Optionally, you can publish the config file:
php artisan vendor:publish --provider="RafaelLaurindo\BrasilApi\BrasilApiServiceProvider" --tag="config"
You can access the package using Dependency Injection, Facade, or Helper.
use RafaelLaurindo\BrasilApi\BrasilApi;
class ExampleController
{
public function searchZipCode(BrasilApi $brasilApi)
{
return response()->json($brasilApi->cep('01431000'));
}
}
use BrasilApi;
BrasilApi::cep('01431000');
brasilApi()->getBank(77);
Make sure you import the Facade when using the examples:
use BrasilApi;
BrasilApi::cep('01431000');
BrasilApi::getBanks();
BrasilApi::getBank(77);
BrasilApi::findCnpj('19131243000197');
To run the package tests, simply execute:
composer test
Please refer to the CHANGELOG to learn about updates and changes.
Feel free to read the CONTRIBUTING guide if you want to contribute to this project.
If you discover a security vulnerability, please review our Security Policy for how to report it.
This package is open-sourced software licensed under the MIT license.