PHPackages                             vsilva472/brcpf - 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. vsilva472/brcpf

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

vsilva472/brcpf
===============

Brazilian CPF validation rule for Laravel (supports formatted and unformatted CPF)

v2.0.1(3mo ago)1361MITPHPPHP &gt;=8.1CI passing

Since Jun 25Pushed 3mo agoCompare

[ Source](https://github.com/vsilva472/brcpf)[ Packagist](https://packagist.org/packages/vsilva472/brcpf)[ RSS](/packages/vsilva472-brcpf/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

🇧🇷 Laravel CPF Validation Rule
==============================

[](#-laravel-cpf-validation-rule)

Laravel CPF validation rule for validating Brazilian CPF numbers (formatted or unformatted).

![Latest Version](https://camo.githubusercontent.com/d00eb033224b549fdc2d86c70a0f1627ac2900a0280fbd7ea82d25ba0053d120/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7673696c76613437322f62726370662e737667)![Downloads](https://camo.githubusercontent.com/f9d31e94c6a4092f6e4d113bc7ad4f14545ea5ec9f9d73e9876ae5ff18bed61e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7673696c76613437322f62726370662e737667)![License](https://camo.githubusercontent.com/586b80d73ca2c24d501fe31dfecd907fa2a9ec88021f3f4fd46f0cecfbc26dea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7673696c76613437322f6272637066)

[🇧🇷 Leia em português](README.pt_BR.md)

---

> ⚠️ **Breaking change**
>
> Version 2+ dropped support for Laravel 9. If you are using Laravel 9, please use version `1.0.x`.

---

✨ Features
----------

[](#-features)

- ✅ Supports formatted and unformatted CPF
- ✅ Laravel 10 → 13+ compatible
- ✅ Zero configuration (auto-discovery)
- ✅ Lightweight and dependency-free
- ✅ Translatable validation messages

---

📦 Installation
--------------

[](#-installation)

```
composer require vsilva472/brcpf
```

🚀 Usage
-------

[](#-usage)

### Inline Validation

[](#inline-validation)

```
use Vsilva472\BrCpf\Rules\Cpf;

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

---

### Form Request

[](#form-request)

```
use Vsilva472\BrCpf\Rules\Cpf;

public function rules()
{
    return [
        'cpf' => ['required', new Cpf()],
    ];
}
```

---

🌍 Custom Error Messages
-----------------------

[](#-custom-error-messages)

Publish the language files:

```
php artisan vendor:publish --tag=brcpf
```

Then edit:

```
lang/vendor/brcpf/validation.php

```

---

🔧 Requirements
--------------

[](#-requirements)

- PHP &gt;= 8.1
- Laravel 10 or higher

> Need support for older Laravel versions? Check:

---

📄 License
---------

[](#-license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance82

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Every ~141 days

Total

3

Last Release

93d ago

Major Versions

v1.0.0 → 2.0.02026-03-31

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4265802?v=4)[Vinicius Silva](/maintainers/vsilva472)[@vsilva472](https://github.com/vsilva472)

---

Top Contributors

[![vsilva472](https://avatars.githubusercontent.com/u/4265802?v=4)](https://github.com/vsilva472 "vsilva472 (12 commits)")

---

Tags

laravelvalidationbrazilcpfcpf validationlaravel cpfbrazilian cpflaravel validation rule

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vsilva472-brcpf/health.svg)

```
[![Health](https://phpackages.com/badges/vsilva472-brcpf/health.svg)](https://phpackages.com/packages/vsilva472-brcpf)
```

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel

3893.6M1](/packages/axlon-laravel-postal-code-validation)[proengsoft/laravel-jsvalidation

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

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[sandermuller/laravel-fluent-validation

Fluent validation rule builders for Laravel

20719.0k4](/packages/sandermuller-laravel-fluent-validation)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1043.3k6](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

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