A Laravel package that provides a simple way to use the Brasil API endpoints.
You can install the package via composer:
composer require rafaellaurindo/laravel-brasilapi
You can publish the config file with:
php artisan vendor:publish --provider="RafaelLaurindo\BrasilApi\BrasilApiServiceProvider" --tag="config"
You can use the methods from Dependency Injection
, Facade
or helper
.
Using from Dependency Injection:
use RafaelLaurindo\BrasilApi\BrasilApi;
class ExampleController
{
public function searchZipCode(BrasilApi $brasilApi)
{
return response()->json($brasilApi->cep('01431000'));
}
}
Using from Facade:
use BrasilApi;
BrasilApi::cep('01431000');
Using from helper:
brasilApi()->getBank(77);
After you've installed the package. All the following examples use the facade. Don't forget to import it at the top of your file.
use BrasilApi;
BrasilApi::cep('01431000');
BrasilApi::getBanks();
BrasilApi::getBank(77);
BrasilApi::findCnpj('19131243000197');
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.