承接 douglasresendemaciel/brazilian-documents-validator 相关项目开发

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

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

douglasresendemaciel/brazilian-documents-validator

Composer 安装命令:

composer require douglasresendemaciel/brazilian-documents-validator

包简介

Validator for LARAVEL to validate CPF, CNPJ and CNH

README 文档

README

This library validate CPF, CNPJ, CNH, TÍTULO DE ELEITOR, NÚMERO DE IDENTIFICAÇÃO SOCIAL, CARTÃO NACIONAL DE SAÚDE, CERTIDÃO (NASCIMENTO/CASAMENTO/ÓBITO) numbers

Installation

Run the following command from you terminal:

composer require "douglasresendemaciel/brazilian-documents-validator:@dev"

or add this to require section in your composer.json file:

"douglasresendemaciel/brazilian-documents-validator"

then run composer update

Once it is installed, you do not need anymore to register in the service provider, the package will be load automatically.

Usage

  • cnpj - Check if the CNPJ number is valid
$this->validate($request, [
    'field_name' => 'required|cnpj',
]);
  • cpf - Check if the CPF number is valid
$this->validate($request, [
    'field_name' => 'required|cpf',
]);
  • cnh - Check if the CNH number is valid
$this->validate($request, [
    'field_name' => 'required|cnh',
]);
  • título de eleitor - Check if the TÍTULO DE ELEITOR number is valid
$this->validate($request, [
    'field_name' => 'required|titulo_eleitor',
]);
  • número de identificação social - Check if the NÚMERO DE IDENTIFICAÇÃO SOCIAL number is valid
$this->validate($request, [
    'field_name' => 'required|nis',
]);
  • cartão nacional de saúde - Check if the CARTÃO NACIONAL DE SAÚDE number is valid
$this->validate($request, [
    'field_name' => 'required|cns',
]);
  • certidão - Check if the CERTIDÃO number is valid
$this->validate($request, [
    'field_name' => 'required|certidao',
]);

OR you can use on RequestValidator files like this:

'rules' => [
...
'field_name' => 'required|cpf',
...

Now is possible create fake document number from this packaged, you just need use the facade GenerateRandomDocument

use DouglasResende\BrazilianDocumentsValidator\Facade\GenerateRandomDocument;

$cpf = GenerateRandomDocument::generateCPF();
$cnpj = GenerateRandomDocument::generateCNPJ();
$cnh = GenerateRandomDocument::generateCNH();

Author

Douglas Resende: http://www.douglasresende.com/

License

References

For more information read the official documentation at https://laravel.com/docs/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固