Back to Validation

Cnpj

docs/validators/Cnpj.md

3.1.11.6 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> SPDX-FileContributor: Ville Hukkamäki <[email protected]> SPDX-FileContributor: William Espindola <[email protected]> -->

Cnpj

  • Cnpj()

Validates the structure and mathematical integrity of Brazilian CNPJ identifiers. Ignores non-digit chars, so use ->digit() if needed.

php
v::cnpj()->assert('00394460005887');
// Validation passes successfully

v::cnpj()->assert('12ABC34501DE35');
// Validation passes successfully

Templates

Cnpj::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a CNPJ
inverted{{subject}} must not be a CNPJ

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Identifications

Changelog

VersionDescription
3.0.0Templates changed
0.3.9Created

See Also