承接 vsilva472/brcpf 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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).

Latest Version Downloads License

🇧🇷 Leia em português

⚠️ 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
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-25