vsilva472/brcpf
最新稳定版本:v2.0.1
Composer 安装命令:
composer require vsilva472/brcpf
包简介
Brazilian CPF validation rule for Laravel (supports formatted and unformatted CPF)
关键字:
README 文档
README
Laravel CPF validation rule for validating Brazilian CPF numbers (formatted or unformatted).
⚠️ Breaking change
Version 2+ dropped support for Laravel 9. If you are using Laravel 9, please use version
1.0.x.
✨ Features
- ✅ Supports formatted and unformatted CPF
- ✅ Laravel 10 → 13+ compatible
- ✅ Zero configuration (auto-discovery)
- ✅ Lightweight and dependency-free
- ✅ Translatable validation messages
📦 Installation
composer require vsilva472/brcpf
🚀 Usage
Inline Validation
use Vsilva472\BrCpf\Rules\Cpf; $request->validate([ 'cpf' => ['required', new Cpf()], ]);
Form Request
use Vsilva472\BrCpf\Rules\Cpf; public function rules() { return [ 'cpf' => ['required', new Cpf()], ]; }
🌍 Custom Error Messages
Publish the language files:
php artisan vendor:publish --tag=brcpf
Then edit:
lang/vendor/brcpf/validation.php
🔧 Requirements
- PHP >= 8.1
- Laravel 10 or higher
Need support for older Laravel versions? Check: https://github.com/vsilva472/laravel-cpf
📄 License
MIT
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-25