ajgl/validator-es

Validation library for some Spanish codes.

Maintainers

πŸ‘ ajgarlag

Package info

github.com/ajgarlag/AjglValidatorEs

pkg:composer/ajgl/validator-es

Statistics

Installs: 3 683

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

0.1.7 2026-06-01 06:29 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8f6f9f81759b3e33efb279051e5d7aa2f2047a36

symfonyvalidatorvalidationesspain

This package is auto-updated.

Last update: 2026-06-01 07:04:58 UTC


README

This library provides some validators for common Spanish codes.

πŸ‘ Build Status
πŸ‘ Latest Stable Version
πŸ‘ Total Downloads
πŸ‘ Latest Unstable Version
πŸ‘ License
πŸ‘ PHP Version Require

Current supported codes to validate are:

  • DNI
  • NIE
  • IdCard (DNI or NIE)
  • CCC
  • IBAN (Limited to Spanish accounts)

Installation

composer require ajgl/validator-es

Usage

All validators implements a common interface with only one method:

<?php
namespace Ajgl\ValidatorEs;

interface ValidatorInterface
{
 public function isValid(mixed $value): bool;
}

To use any validator, you must instantiate it, and call the isValid method:

<?php
require 'vendor/autoload.php';

$value = 'Y0000000Z';
$validator = new \Ajgl\ValidatorEs\IdCardValidator();
assert($validator->isValid($value));

License

This library is released under an open source license. See the complete license in the LICENSE file.

Reporting an issue or a feature request

Read the CONTRIBUTING.md file.

Author Information

Developed with β™₯ by Antonio J. GarcΓ­a Lagar.

If you find this library useful, please add a β˜… in the GitHub repository page.