https://github.com/torralbodavid/identity-card-checker
🛂 Use this package to validate the identity card from your country using laravel validation rules.
https://github.com/torralbodavid/identity-card-checker
cif dni laravel nie rules
Last synced: about 1 month ago
JSON representation
🛂 Use this package to validate the identity card from your country using laravel validation rules.
- Host: GitHub
- URL: https://github.com/torralbodavid/identity-card-checker
- Owner: torralbodavid
- License: mit
- Created: 2021-11-07T18:41:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-07T23:22:06.000Z (over 3 years ago)
- Last Synced: 2025-03-02T00:12:06.447Z (2 months ago)
- Topics: cif, dni, laravel, nie, rules
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Identity Card Checker Laravel Validation Rules
[](https://packagist.org/packages/torralbodavid/identity-card-checker)
[](https://packagist.org/packages/torralbodavid/identity-card-checker)
[](https://packagist.org/packages/torralbodavid/identity-card-checker) [](https://packagist.org/packages/torralbodavid/identity-card-checker)
[](https://github.com/torralbodavid/identity-card-checker/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/torralbodavid/identity-card-checker/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)Use this package to validate the identity card number from your country
## Installation
You can install the package via composer:
```bash
composer require torralbodavid/identity-card-checker
```You can publish the config file with:
```bash
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:
```php
use Torralbodavid\IdentityCardChecker\Rules\IdCardES;
$request->validate([
...
'id_validation' => new IdCard('es'),
]);
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [David Torralbo](https://github.com/torralbodavid)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.