Skip to content

Commit 64afdce

Browse files
Merge pull request #3 from rafaellaurindo/feat/laravel-12
Add support to Laravel 12 🚀
2 parents 9832bf0 + 9943626 commit 64afdce

File tree

4 files changed

+108
-42
lines changed

4 files changed

+108
-42
lines changed
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
name: run-tests
1+
name: tests
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
811

912
jobs:
1013
test:
1114
runs-on: ${{ matrix.os }}
1215
strategy:
1316
fail-fast: true
1417
matrix:
15-
os: [ubuntu-latest, windows-latest]
18+
os: [ubuntu-latest]
1619
php: [8.0]
1720
laravel: [8.*]
1821
stability: [prefer-lowest, prefer-stable]
@@ -24,24 +27,19 @@ jobs:
2427

2528
steps:
2629
- name: Checkout code
27-
uses: actions/checkout@v2
30+
uses: actions/checkout@v4
2831

2932
- name: Setup PHP
3033
uses: shivammathur/setup-php@v2
3134
with:
3235
php-version: ${{ matrix.php }}
33-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
36+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, intl, fileinfo
3437
coverage: none
3538

36-
- name: Setup problem matchers
37-
run: |
38-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
39-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
40-
4139
- name: Install dependencies
4240
run: |
4341
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4442
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4543
4644
- name: Execute tests
47-
run: composer test
45+
run: composer run test

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [1.0.4] - 2025-04-26
8+
### Added
9+
- Support for Laravel 12.
10+
11+
## [1.0.3] - 2024-04-15
12+
### Added
13+
- Support for Laravel 11. ([#2](https://github.com/rafaellaurindo/laravel-brasilapi/pull/2) by [@pedro-santiago](https://github.com/pedro-santiago))
14+
15+
## [1.0.2] - 2023-03-06
16+
### Added
17+
- Support for Laravel 10. ([#1](https://github.com/rafaellaurindo/laravel-brasilapi/pull/1) by [@pedro-santiago](https://github.com/pedro-santiago))
18+
19+
## [1.0.1] - 2022-03-03
20+
### Added
21+
- Support for Laravel 9.
22+
23+
## [1.0.0] - 2021-11-12
24+
### Added
25+
- Initial release providing methods to access Brasil API endpoints:
26+
- Retrieve Brazilian banks list and details by code.
27+
- Get address information by CEP (postal code).
28+
- Retrieve company information by CNPJ (business registration number).

README.md

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
# Laravel Brasil API
1+
# Laravel Brasil API 🇧🇷
22

33
[![Latest Stable Version](http://poser.pugx.org/rafaellaurindo/laravel-brasilapi/v)](https://packagist.org/packages/rafaellaurindo/laravel-brasilapi)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/rafaellaurindo/laravel-brasilapi/run-tests?label=tests)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/rafaellaurindo/laravel-brasilapi/Check%20&%20fix%20styling?label=code%20style)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
6-
[![License](https://img.shields.io/github/license/rafaellaurindo/laravel-brasilapi)](https://github.com/rafaellaurindo/laravel-brasilapi/blob/main/LICENSE.md)
4+
[![Tests](https://img.shields.io/github/actions/workflow/status/rafaellaurindo/laravel-brasilapi/run-tests.yml?label=tests)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![Code Style](https://img.shields.io/github/actions/workflow/status/rafaellaurindo/laravel-brasilapi/php-cs-fixer.yml?label=code%20style)](https://github.com/rafaellaurindo/laravel-brasilapi/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
6+
[![License](https://img.shields.io/github/license/rafaellaurindo/laravel-brasilapi)](LICENSE.md)
77
[![Total Downloads](https://img.shields.io/packagist/dt/rafaellaurindo/laravel-brasilapi)](https://packagist.org/packages/rafaellaurindo/laravel-brasilapi)
88

9-
A Laravel package that provides a simple way to use the [Brasil API](https://brasilapi.com.br/) endpoints.
9+
**Laravel Brasil API** is a simple and elegant package to easily consume [Brasil API](https://brasilapi.com.br/) endpoints within your Laravel applications.
1010

11-
## Installation
11+
---
1212

13-
You can install the package via composer:
13+
## 📑 Table of Contents
14+
15+
- [Installation](#-installation)
16+
- [Usage](#-usage)
17+
- [Examples](#-examples)
18+
- [Running Tests](#-running-tests)
19+
- [Changelog](#-changelog)
20+
- [Contributing](#-contributing)
21+
- [Security Vulnerabilities](#-security-vulnerabilities)
22+
- [Credits](#-credits)
23+
- [License](#-license)
24+
25+
---
26+
27+
## 📦 Installation
28+
29+
> **Requirements:**
30+
> This package supports **Laravel 8.0 and above**.
31+
32+
Install the package via Composer:
1433

1534
```bash
1635
composer require rafaellaurindo/laravel-brasilapi
1736
```
1837

19-
You can publish the config file with:
38+
Optionally, you can publish the config file:
2039

2140
```bash
2241
php artisan vendor:publish --provider="RafaelLaurindo\BrasilApi\BrasilApiServiceProvider" --tag="config"
2342
```
2443

25-
## Usage
44+
---
45+
46+
## 🚀 Usage
2647

27-
You can use the methods from `Dependency Injection`, `Facade` or `helper`.
48+
You can access the package using **Dependency Injection**, **Facade**, or **Helper**.
2849

29-
Using from Dependency Injection:
50+
### 1. Using Dependency Injection
3051

3152
```php
3253
use RafaelLaurindo\BrasilApi\BrasilApi;
@@ -40,73 +61,91 @@ class ExampleController
4061
}
4162
```
4263

43-
Using from Facade:
64+
### 2. Using Facade
4465

4566
```php
4667
use BrasilApi;
4768

4869
BrasilApi::cep('01431000');
4970
```
5071

51-
Using from helper:
72+
### 3. Using Helper
5273

5374
```php
5475
brasilApi()->getBank(77);
5576
```
5677

57-
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.
78+
---
79+
80+
## 📚 Examples
81+
82+
Make sure you import the Facade when using the examples:
5883

5984
```php
6085
use BrasilApi;
6186
```
6287

63-
### Searching address by zip code:
88+
### 🔎 Search address by zip code
6489

6590
```php
6691
BrasilApi::cep('01431000');
6792
```
6893

69-
### Get Brazilian banks list:
94+
### 🏦 List Brazilian banks
7095

7196
```php
7297
BrasilApi::getBanks();
7398
```
7499

75-
### Get a bank from code:
100+
### 🏛️ Get a bank by its code
76101

77102
```php
78103
BrasilApi::getBank(77);
79104
```
80105

81-
### Find company information using the CNPJ:
106+
### 🏢 Find company information by CNPJ
82107

83108
```php
84109
BrasilApi::findCnpj('19131243000197');
85110
```
86111

87-
## Testing
112+
---
113+
114+
## ✅ Running Tests
115+
116+
To run the package tests, simply execute:
88117

89118
```bash
90119
composer test
91120
```
92121

93-
## Changelog
122+
---
123+
124+
## 📋 Changelog
125+
126+
Please refer to the [CHANGELOG](CHANGELOG.md) to learn about updates and changes.
94127

95-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
128+
---
96129

97-
## Contributing
130+
## 🤝 Contributing
98131

99-
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
132+
Feel free to read the [CONTRIBUTING](.github/CONTRIBUTING.md) guide if you want to contribute to this project.
100133

101-
## Security Vulnerabilities
134+
---
102135

103-
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
136+
## 🔐 Security Vulnerabilities
104137

105-
## Credits
138+
If you discover a security vulnerability, please review our [Security Policy](../../security/policy) for how to report it.
139+
140+
---
141+
142+
## 👨‍💻 Credits
106143

107144
- [Rafael Laurindo](https://github.com/rafaellaurindo)
108145
- [All Contributors](../../contributors)
109146

110-
## License
147+
---
148+
149+
## 📄 License
111150

112-
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
151+
This package is open-sourced software licensed under the [MIT license](LICENSE.md).

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
"require": {
2121
"php": "^8.0",
2222
"guzzlehttp/guzzle": "^7.4",
23-
"laravel/framework": "^8.0|^9.0|^10.0|^11.0"
23+
"laravel/framework": "^8.0|^9.0|^10.0|^11.0|^12.0"
2424
},
2525
"require-dev": {
26-
"brianium/paratest": "^6.3",
26+
"brianium/paratest": "^6.3|^7.0|^7.5",
2727
"friendsofphp/php-cs-fixer": "^3.2",
2828
"nunomaduro/collision": "^5.10|^6.0|^7.0",
29-
"orchestra/testbench": "^6.23",
30-
"phpunit/phpunit": "^9.5|^10.0"
29+
"orchestra/testbench": "^6.23|^7.0|^8.0",
30+
"phpunit/phpunit": "^9.5|^10.0|^11.5.3|^12.0.1"
31+
3132
},
3233
"autoload": {
3334
"psr-4": {

0 commit comments

Comments
 (0)