Download the PHP package lumensistemas/br-validation without Composer
On this page you can find all versions of the php package lumensistemas/br-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download lumensistemas/br-validation
More information about lumensistemas/br-validation
Files in lumensistemas/br-validation
Download lumensistemas/br-validation
More information about lumensistemas/br-validation
Files in lumensistemas/br-validation
Vendor lumensistemas
Package br-validation
Short Description Validators, generators, and formatters for Brazilian identifiers (CPF, CNPJ, PIS, Título de Eleitor, CNH, Renavam, placa de veículo, CNS, chave PIX, CEP, telefone, boleto bancário, and NF-e access key).
License MIT
Package br-validation
Short Description Validators, generators, and formatters for Brazilian identifiers (CPF, CNPJ, PIS, Título de Eleitor, CNH, Renavam, placa de veículo, CNS, chave PIX, CEP, telefone, boleto bancário, and NF-e access key).
License MIT
Please rate this library. Is it a good library?
Informations about the package br-validation
br-validation
Validators, generators, and formatters for Brazilian identifiers (CPF and CNPJ) in PHP. Framework-agnostic and dependency-free at runtime.
Requirements
- PHP 8.3 or newer
ext-mbstring
Installation
Usage
CPF
CNPJ
Behavior
- Validation never throws.
isValidaccepts any input type and returnsfalsefor non-string or malformed values. Callers can pass user input directly withouttry/catch. - All-equal sequences are rejected (
11111111111,00000000000000, …) even though they pass the mod-11 algorithm. They are conventional placeholder values across the Brazilian validation ecosystem and never represent real identifiers. - CNPJ is case-insensitive. Letters in alphanumeric
CNPJs are normalized to uppercase before validation and
formatting; both
'12abc34501de35'and'12ABC34501DE35'validate equivalently, andformatalways produces the canonical uppercase masked form. - Numeric CNPJs remain valid in perpetuity alongside the 2026 alphanumeric format. This is an accept-both library, not a transitional one.
format()is tolerant. When the input shape doesn't match the canonical form,format()returns the input unchanged rather than raising. It does not validate check digits — that isisValid()'s job.
Laravel integration
A companion package lumensistemas/laravel-br-validation
is planned, providing Rule classes and a service
provider. It will be linked here once published.
Development
License
MIT. See LICENSE.
All versions of br-validation with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
ext-mbstring Version *
ext-mbstring Version *
The package lumensistemas/br-validation contains the following files
Loading the files please wait ...