承接 mateusjunges/cpf-cnpj-validator 相关项目开发

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

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

mateusjunges/cpf-cnpj-validator

最新稳定版本:v1.0.0

Composer 安装命令:

composer require mateusjunges/cpf-cnpj-validator

包简介

A simple class to validate CPF and CNPJ numbers

README 文档

README

art/laravel-kafka.png

This package provide a simple API to validate brazilian CPF and CNPJ document numbers.

Sponsor my work!

If you think this package helped you in any way, you can sponsor me on GitHub!

Sponsor Me

Installation

You can install this package using composer:

composer require mateusjunges/cpf-cnpj-validator

Usage

To validate a document number, you can invoke the Validator class passing the number and optionally the document type as parameters:

use Junges\CpfCnpjValidator\Validator;

$v = (new Validator)("360.928.960-01"); // True

$v = (new Validator)("360.928.960-01", \Junges\CpfCnpjValidator\Enums\TaxId::CPF); // True

$v = (new Validator)("360.928.960-01", \Junges\CpfCnpjValidator\Enums\TaxId::CNPJ); // False

$v = (new Validator)("91.881.588/0001-95"); // True

$v = (new Validator)("91.881.588/0001-95", \Junges\CpfCnpjValidator\Enums\TaxId::CNPJ); // True

$v = (new Validator)("91.881.588/0001-95", \Junges\CpfCnpjValidator\Enums\TaxId::CPF); // True

Testing

Run composer test to test this package.

Credits

License

This package is open-sourced software licensed under the MIT License. Please see the License file for more information.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-19