PHPackages                             mpijierro/identity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mpijierro/identity

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mpijierro/identity
==================

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

1.1.0(6y ago)721.5k↓23.1%6[1 PRs](https://github.com/mpijierro/identity/pulls)MITPHPCI passing

Since Jul 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/mpijierro/identity)[ Packagist](https://packagist.org/packages/mpijierro/identity)[ RSS](/packages/mpijierro-identity/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Identity for Laravel/Lumen ^5.1|6.X
===================================

[](#identity-for-laravellumen-516x)

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

Installation
------------

[](#installation)

Laravel 5.8 or greather =&gt; master

Laravel 5.1 to 5.7 =&gt; 1.1.0

Require this package with composer:

Add in the require section of your composer.json

```
composer require mpijierro/identity

```

### Laravel/Lumen

[](#laravellumen)

```
\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
-----

[](#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
------

[](#thanks)

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

Thanks to original code of: globalcitizen/php-iban

Thanks to original code for the validation of the NNSS of:

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance53

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 68.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a66c8e3f8b4e2fc7b18f101bac8da88dd9ffa9036d1de9e1992754783302bca4?d=identicon)[mpijierro](/maintainers/mpijierro)

---

Top Contributors

[![mpijierro](https://avatars.githubusercontent.com/u/2911395?v=4)](https://github.com/mpijierro "mpijierro (31 commits)")[![marcmascort](https://avatars.githubusercontent.com/u/3595718?v=4)](https://github.com/marcmascort "marcmascort (8 commits)")[![antoiba86](https://avatars.githubusercontent.com/u/17474272?v=4)](https://github.com/antoiba86 "antoiba86 (6 commits)")

---

Tags

laravelnifphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpijierro-identity/health.svg)

```
[![Health](https://phpackages.com/badges/mpijierro-identity/health.svg)](https://phpackages.com/packages/mpijierro-identity)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
