conycom/laravel-spanish-validation

The most comprehensive Spanish validation rules for Laravel (DNI, NIE, CIF, IBAN, and more).

Maintainers

Package info

github.com/conycom/laravel-spanish-validation

pkg:composer/conycom/laravel-spanish-validation

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-08-12 11:06 UTC

This package is auto-updated.

Last update: 2026-08-12 11:15:11 UTC


README

The most comprehensive, modern, and tested suite of Spanish validation rules for Laravel 10 and 11.

Run tests

Features

  • DNI Validation (Documento Nacional de Identidad)
  • NIE Validation (Número de Identidad de Extranjero)
  • CIF Validation (Código de Identificación Fiscal)
  • Spanish IBAN Validation (Modulo 97 checksum for Spanish bank accounts)
  • Translations included (English and Spanish)

Installation

You can install the package via composer:

composer require conycom/laravel-spanish-validation

Usage

You can use the provided rules in your FormRequests or inline validations. They implement the native Illuminate\Contracts\Validation\ValidationRule interface.

use Conycom\SpanishValidation\Rules\ValidDni;
use Conycom\SpanishValidation\Rules\ValidNie;
use Conycom\SpanishValidation\Rules\ValidCif;
use Conycom\SpanishValidation\Rules\ValidSpanishIban;

$request->validate([
    'dni' => ['required', new ValidDni()],
    'nie' => ['required', new ValidNie()],
    'cif' => ['required', new ValidCif()],
    'iban' => ['required', new ValidSpanishIban()],
]);

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.