mpijierro/identity 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mpijierro/identity

最新稳定版本:1.1.0

Composer 安装命令:

composer require mpijierro/identity

包简介

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

README 文档

README

Check valid spanish document id as NIF, CIF, NIE and IBAN back account.

Installation

Laravel 5.8 or greather => master

Laravel 5.1 to 5.7 => 1.1.0

Require this package with composer:

Add in the require section of your composer.json

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:

'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.

Usage

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

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

methods returns true or false

It is also possible to use validation rules:

'nif_field' => 'nif'

'cif_field' => 'cif'

'nie_field' => 'nie'

'iban_field' => 'iban'

'nnss_field' => 'nnss'

If error ocurred, error message will be:

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

Thanks

The original code for NIF, CIF AND NIE is in next link

http://www.michublog.com/informatica/8-funciones-para-la-validacion-de-formularios-con-expresiones-regulares

Thanks to original code of: globalcitizen/php-iban

https://github.com/globalcitizen/php-iban

Thanks to original code for the validation of the NNSS of: http://intervia.com

http://intervia.com/doc/validar-numeros-de-la-seguridad-social/

统计信息

  • 总下载量: 20.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-18