PHPackages                             lumensistemas/br-validation-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. lumensistemas/br-validation-laravel

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

lumensistemas/br-validation-laravel
===================================

A Laravel package that provides validation rules for Brazilian documents.

1.0.0(1mo ago)00[1 PRs](https://github.com/lumensistemas/br-validation-laravel/pulls)MITPHPPHP ^8.4CI passing

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/lumensistemas/br-validation-laravel)[ Packagist](https://packagist.org/packages/lumensistemas/br-validation-laravel)[ Docs](https://github.com/lumensistemas/br-validation-laravel)[ GitHub Sponsors](https://github.com/lumensistemas)[ RSS](/packages/lumensistemas-br-validation-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

Brazilian Validation Rules for Laravel
======================================

[](#brazilian-validation-rules-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b9c29922987baeefd75c87bde9d551703d1b4ece3c4c1e2fe6c9272c884e14cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756d656e73697374656d61732f62722d76616c69646174696f6e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lumensistemas/br-validation-laravel)[![Tests](https://camo.githubusercontent.com/e4befb21b6cf617364a272f0621254f17dd4740c0a20a8d7ae58f8e5f93e9d5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c756d656e73697374656d61732f62722d76616c69646174696f6e2d6c61726176656c2f7061636b6167652d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/lumensistemas/br-validation-laravel/actions/workflows/package-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/5cf92f79c31211d6e6743b72176b50c66f048c18c8b1ed30ada491d29d95d12a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756d656e73697374656d61732f62722d76616c69646174696f6e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lumensistemas/br-validation-laravel)

A Laravel package that provides validation rules for Brazilian documents such as CPF and CNPJ (including the new alphanumeric format).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lumensistemas/br-validation-laravel
```

The service provider is auto-discovered by Laravel. Translations for `en` and `pt_BR` are included out of the box.

You can optionally publish the translation files:

```
php artisan vendor:publish --tag=br-validation-lang
```

Usage
-----

[](#usage)

### CPF

[](#cpf)

```
use LumenSistemas\BrValidation\Rules\Cpf;

$request->validate([
    'cpf' => ['required', new Cpf],
]);
```

Accepts both masked (`529.982.247-25`) and unmasked (`52998224725`) formats.

### CNPJ

[](#cnpj)

```
use LumenSistemas\BrValidation\Rules\Cnpj;

$request->validate([
    'cnpj' => ['required', new Cnpj],
]);
```

Accepts masked (`11.222.333/0001-81`), unmasked (`11222333000181`), and alphanumeric (`12ABC34501DE35`) formats.

Testing
-------

[](#testing)

```
composer test:all
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/lumensistemas/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Lucas Vasconcelos](https://github.com/lucasvscn)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfdf6591a8b2d844569545878fba113e9c8de3d9b9d48f5b25637c6f0353ffbd?d=identicon)[lucasvscn](/maintainers/lucasvscn)

---

Top Contributors

[![lucasvscn](https://avatars.githubusercontent.com/u/3482569?v=4)](https://github.com/lucasvscn "lucasvscn (2 commits)")

---

Tags

laravelvalidationcpfcnpjlumensistemasbr-validation-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lumensistemas-br-validation-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/lumensistemas-br-validation-laravel/health.svg)](https://phpackages.com/packages/lumensistemas-br-validation-laravel)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

759569.4k13](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
