定制 fernandorech/br-commons 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fernandorech/br-commons

Composer 安装命令:

composer require fernandorech/br-commons

包简介

Helps creates CPF and CNPJ validations

README 文档

README

Total Downloads License

BrCommons validator is a set of useful validators that helps you develop fast and reliable code. Has zero dependencies.

Installation by composer

Run composer require fernandorech/br-commons.

Updates

Has the new validation CNPJ Alfanumérico.

BrCommons

It's a class that helps you to validate and format CPF and CNPJ by given a string.

Examples 1: Simple document format

use BrCommons\BrCommons;
    $document = BrCommons::from('44975583046');
    echo $document->toString(); // will print '449.755.830-46'

Example 2: validation of a cpf

    if(BrCommons::isValid('44975583046') {
        // do some code
    } else {
        // other stuff
    }

Example 3: throw an exception if a document is not valid

try {
    $document = BrCommons::from('4497558', true); //it will thrown an exception
} catch (DocumentException $e) {
    //do code
}

Example 4: Return formatted value without create an object

echo BrCommons::format('44975583046');

Example 5: Use CPF or CNPJ directly

$cpf = CPF::from('44975583046');
$cnpj  CNPJ::from('14328920000148');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固