Looking to hire Laravel developers? Try LaraJobs

laravel-spanishid maintained by interficie

Description
Check spanish identity numbers (DNI, CIF, NIE, NIF, SSN)
Author
Last update
2024/11/19 14:51 (dev-master)
License
Links
Downloads
6 703
Tags

Comments
comments powered by Disqus

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