Nif

February 3, 2026 · View on GitHub

  • Nif()

Validates Spain's fiscal identification number (NIF).

v::nif()->assert('49294492H');
// Validation passes successfully

v::nif()->assert('P6437358A');
// → "P6437358A" must be a NIF

Templates

Nif::TEMPLATE_STANDARD

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

Template placeholders

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

Categorization

  • Identifications

Changelog

VersionDescription
3.0.0Templates changed
2.2.0Created

See Also