rafahernandez / rfc-validator
Utility to validate string for Mexican RFC
Fund package maintenance!
:vendor_name
Requires
- php: ^7.4|^8.0
- illuminate/contracts: ^7.0|^8.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^5.0|^6.6
- pestphp/pest: ^1.18
- pestphp/pest-plugin-laravel: ^1.1
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
Español
Este paquete contiene una regla para validar RFC (Registro Federal de contribuyentes) mexicanos.
No valida las fechas, ni hace llamadas externas para comprobar si existen.
English
This package contains a rule to validate Mexican RFCs (Equivalent to other countries Tax ID).
It does not validate the dates, nor does it make external calls to check if they exist.
Installation
You can install the package via composer:
composer require rafahernandez/rfc-validator
Usage
use RafaHernandez\RfcValidator\RFC; $request->validate([ 'rfc' => ['required', new RFC()], ]);
Optional, define the type of fiscal person
use RafaHernandez\RfcValidator\RFC; // XAXX010101000 will fail // XAX010101000 will pass $request->validate([ 'rfc' => ['required', new RFC(RFC::PERSONA_MORAL)], //also available PERSONA_FISICA ]);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.