Skip to content

Laravel package adding validations for spanish state-emitted document identification numbers (DNI, NIF, NIE, etc.)

License

Notifications You must be signed in to change notification settings

InterficieIS/laravel-spanishid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpanishID for Laravel 6.X|7.X

Library to add validations for spanish state-emitted identity document numbers, including NIF, CIF, NIE and Social Security Number (SSN).

Installation

Require this package with composer:

composer require interficie/identity

Usage

You can now check a document using the Facade:

SpanishID::isValidDni('1234foo');
SpanishID::isValidCif('1234foo');
SpanishID::isValidNie('1234foo');
SpanishID::isValidNNSS('1234foo');

You can also use these as validation rules:

$rules = [
    'dni_field' => 'dni',
    'cif_field' => 'cif',
    'nie_field' => 'nie',
    'nif_field' => 'nif',
    'nnss_field' => 'nnss',
];

Thanks

About

Laravel package adding validations for spanish state-emitted document identification numbers (DNI, NIF, NIE, etc.)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages