2017 © Pedro Peláez
 

library identity

Check identity number as NIF, CIF, NIE...

image

mpijierro/identity

Check identity number as NIF, CIF, NIE...

  • Monday, February 5, 2018
  • by mpijierro
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,342 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 16 % Grown

The README.md

Identity for Laravel/Lumen ^5.1|6.X

Check valid spanish document id as NIF, CIF, NIE and IBAN back account., (*1)

Installation

Laravel 5.8 or greather => master, (*2)

Laravel 5.1 to 5.7 => 1.1.0, (*3)

Require this package with composer:, (*4)

Add in the require section of your composer.json, (*5)

composer require mpijierro/identity

Laravel/Lumen

\MPijierro\Identity\IdentityServiceProvider::class,

If you want to use the facade, add this to your facades in app.php:, (*6)

'Identity' => MPijierro\Identity\Facades\Identity::class,

Note: Branch 1.1 has a modification in which the default error messages have been removed. If you use this branch, you must add the validation messages you want to your language file., (*7)

Usage

You can now check document ide using the Facade (when added), (*8)

Identity::isValidCif('1234foo');
Identity::isValidNif('1234foo');
Identity::isValidNie('1234foo');
Identity::isValidIban('1234foo');
Identity::isValidNNSS('1234foo');

methods returns true or false, (*9)

It is also possible to use validation rules:, (*10)

'nif_field' => 'nif'

'cif_field' => 'cif'

'nie_field' => 'nie'

'iban_field' => 'iban'

'nnss_field' => 'nnss'

If error ocurred, error message will be:, (*11)

 "The $foo_attribute field is not a valid Foo.";

Thanks

The original code for NIF, CIF AND NIE is in next link, (*12)

http://www.michublog.com/informatica/8-funciones-para-la-validacion-de-formularios-con-expresiones-regulares, (*13)

Thanks to original code of: globalcitizen/php-iban, (*14)

https://github.com/globalcitizen/php-iban, (*15)

Thanks to original code for the validation of the NNSS of: http://intervia.com, (*16)

http://intervia.com/doc/validar-numeros-de-la-seguridad-social/, (*17)

The Versions

05/02 2018

dev-master

9999999-dev

Check identity number as NIF, CIF, NIE...

  Sources   Download

MIT

The Requires

 

The Development Requires

by Manu Pijierro