PHPackages                             kineticamobile/laravel-spanish-validator - 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. kineticamobile/laravel-spanish-validator

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

kineticamobile/laravel-spanish-validator
========================================

Laravel validator for spanish stuff: NIF, NIE, CIF, NSS, IBAN, Postal Code, Phone numbers

v2.0(1y ago)089MITPHPPHP ^8.2

Since Jun 17Pushed 1y agoCompare

[ Source](https://github.com/kineticamobile/laravel-spanish-validator)[ Packagist](https://packagist.org/packages/kineticamobile/laravel-spanish-validator)[ Docs](https://github.com/kineticamobile/laravel-spanish-validator)[ RSS](/packages/kineticamobile-laravel-spanish-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Laravel validator for spanish stuff: NIF, NIE, CIF, NSS, IBAN, Postal Code, Phone numbers
=========================================================================================

[](#laravel-validator-for-spanish-stuff-nif-nie-cif-nss-iban-postal-code-phone-numbers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/85fce53033e1e4be2037740f45e7114632c285625d16e0a420b102cfb57f58d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f72756d61642f6c61726176656c2d7370616e6973682d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/orumad/laravel-spanish-validator)[![StyleCI](https://camo.githubusercontent.com/662b67d478aac15063f29303ec8d9fdb0166199c3fcd683819a099aa6c112b7a/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3138343737303138322f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/184770182)[![Quality Score](https://camo.githubusercontent.com/53976fc86ddc45d7c3b23bf13d09241f6f46ba6c7b8f8ca02f96343a8f1cf45a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6f72756d61642f6c61726176656c2d7370616e6973682d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/orumad/laravel-spanish-validator)[![Total Downloads](https://camo.githubusercontent.com/1f7be6374471aa99704962e62cc4f4c78db52104907d167512c34d960537d07c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f72756d61642f6c61726176656c2d7370616e6973682d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/orumad/laravel-spanish-validator)

This package is a set of diferent validation rules for spanish national id numbers like:

- **NIF**: *"Número de Identificación Fiscal"* (tax number for individuals).
- **NIE**: *"Número de Idenfiticación para Extranjeros"* (identity number for foreigners).
- **CIF**: *"Código de Identificación Fiscal"* (tax number for companies).
- **NSS**: *"Número de la Seguridad Social"* (national security number).

Also the package include validators for:

- **IBAN**: International Bank Account Number.
- **Postal codes**: Spanish postal codes.
- **Phone number**: Spanish phone numbers format.

Instalation
-----------

[](#instalation)

The package can be installed via composer:

```
composer require orumad/laravel-spanish-validator
```

The package will automatically register itself.

If you want to edit the validation messages, you should run the following command to publish the translation files into your `resources/lang` folder:

```
php artisan vendor:publish --provider="Orumad\SpanishValidator\SpanishValidatorServiceProvider"
```

Available rules
---------------

[](#available-rules)

- [`nif`](#nif)
- [`nie`](#nie)
- [`cif`](#cif)
- [`spanish_tax_number`](#spanish_tax_number)
- [`spanish_personal_id`](#spanish_personal_id)
- [`nss`](#nss)
- [`iban`](#iban)
- [`spanish_postal_code`](#spanish_postal_code)
- [`spanish_phone`](#spanish_phone)

### `nif`

[](#nif)

Determine if the input is a valid *"Número de Identificación Fiscal"* (tax number for individuals).

### `nie`

[](#nie)

Determine if the field under validation is a valid *"Número de Idenfiticación para Extranjeros"* (identity number for foreigners).

### `cif`

[](#cif)

This rule will validate if the input field is a valid *"Código de Identificación Fiscal"* (tax number for companies).

### `spanish_tax_number`

[](#spanish_tax_number)

This rule validates if the input is a valid spanish tax number: NIF or NIE or CIF.

### `spanish_personal_id`

[](#spanish_personal_id)

Will validate if the input is a valid personal id number in Spain (NIF or NIE).

### `nss`

[](#nss)

Determine if the field under validation is a valid "Número de la Seguridad Social"\_ (national security number).

### `iban`

[](#iban)

Test if the input field is a valid IBAN bank account number. *(This uses the package `globalcitizen/php-iban` to check the validity of IBAN)*

### `spanish_postal_code`

[](#spanish_postal_code)

Will check if the postal code is a valid spanish postal code.

### `spanish_phone`

[](#spanish_phone)

This tule validates if the input field content is a valid spanish phone number format.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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 ~316 days

Total

2

Last Release

378d ago

Major Versions

v1.0 → v2.02025-04-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/073118431f7562f2532163e5dc4305cd0df6ec0f949ab7d2ebed21e9ab03ee6f?d=identicon)[dmaciasr](/maintainers/dmaciasr)

---

Top Contributors

[![enricv](https://avatars.githubusercontent.com/u/2940681?v=4)](https://github.com/enricv "enricv (5 commits)")[![dmaciasr](https://avatars.githubusercontent.com/u/8624950?v=4)](https://github.com/dmaciasr "dmaciasr (1 commits)")[![LorenzoRamalho](https://avatars.githubusercontent.com/u/4308861?v=4)](https://github.com/LorenzoRamalho "LorenzoRamalho (1 commits)")[![rubenmdh](https://avatars.githubusercontent.com/u/16972011?v=4)](https://github.com/rubenmdh "rubenmdh (1 commits)")

---

Tags

laravellaravel-packagelaravel-validation-ruleslaravel-validatororumad

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kineticamobile-laravel-spanish-validator/health.svg)

```
[![Health](https://phpackages.com/badges/kineticamobile-laravel-spanish-validator/health.svg)](https://phpackages.com/packages/kineticamobile-laravel-spanish-validator)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[danielebarbaro/laravel-vat-eu-validator

A simple package that validates EU VAT numbers against the central ec.europa.eu database

37369.4k](/packages/danielebarbaro-laravel-vat-eu-validator)

PHPackages © 2026

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