Skip to content

A Laravel package that provides a simple way to use the Brasil API endpoints.

License

Notifications You must be signed in to change notification settings

rafaellaurindo/laravel-brasilapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Laravel Brasil API πŸ‡§πŸ‡·

Latest Stable Version Tests Code Style License Total Downloads

Laravel Brasil API is a simple and elegant package to easily consume Brasil API endpoints within your Laravel applications.


πŸ“‘ Table of Contents


πŸ“¦ Installation

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"

πŸš€ Usage

You can access the package using Dependency Injection, Facade, or Helper.

1. Using Dependency Injection

use RafaelLaurindo\BrasilApi\BrasilApi;

class ExampleController
{
    public function searchZipCode(BrasilApi $brasilApi)
    {
        return response()->json($brasilApi->cep('01431000'));
    }
}

2. Using Facade

use BrasilApi;

BrasilApi::cep('01431000');

3. Using Helper

brasilApi()->getBank(77);

πŸ“š Examples

Make sure you import the Facade when using the examples:

use BrasilApi;

πŸ”Ž Search address by zip code

BrasilApi::cep('01431000');

🏦 List Brazilian banks

BrasilApi::getBanks();

πŸ›οΈ Get a bank by its code

BrasilApi::getBank(77);

🏒 Find company information by CNPJ

BrasilApi::findCnpj('19131243000197');

βœ… Running Tests

To run the package tests, simply execute:

composer test

πŸ“‹ Changelog

Please refer to the CHANGELOG to learn about updates and changes.


🀝 Contributing

Feel free to read the CONTRIBUTING guide if you want to contribute to this project.


πŸ” Security Vulnerabilities

If you discover a security vulnerability, please review our Security Policy for how to report it.


πŸ‘¨β€πŸ’» Credits


πŸ“„ License

This package is open-sourced software licensed under the MIT license.

About

A Laravel package that provides a simple way to use the Brasil API endpoints.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages