torralbodavid/identity-card-checker

Use this package to validate the identity card number from your country

2.0.2 2021-11-07 23:21 UTC

This package is auto-updated.

Last update: 2024-04-08 04:48:59 UTC


README

Latest Stable Version Total Downloads License PHP Version Require GitHub Tests Action Status GitHub Code Style Action Status

Use this package to validate the identity card number from your country

Installation

You can install the package via composer:

composer require torralbodavid/identity-card-checker

You can publish the config file with:

php artisan vendor:publish --provider="Torralbodavid\IdentityCardChecker\IdentityCardCheckerServiceProvider" --tag="identity-card-checker-config"

Usage

🇪🇸 Currently we are only supporting validation of Spanish documents: DNI, NIE and CIF.

Feel free to open an issue if you want your country id to be supported or also open a pull request.

Add the following rule on your form validation:

    use Torralbodavid\IdentityCardChecker\Rules\IdCardES;

    
    $request->validate([
        ...
        'id_validation' => new IdCard('es'),
    ]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

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

Credits

License

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