Download the PHP package jeandepaula/country-validations without Composer
On this page you can find all versions of the php package jeandepaula/country-validations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeandepaula/country-validations
More information about jeandepaula/country-validations
Files in jeandepaula/country-validations
Package country-validations
Short Description A PHP library for validating personal, corporate, banking, and vehicle data for Brazil, USA, and Canada.
License MIT
Informations about the package country-validations
Country Validations Library
The Country Validations Library is a powerful PHP package designed to validate various data formats for Brazil, Canada, and the USA. The library provides easy-to-use methods for personal, corporate, banking, and vehicle data validation.
Features
Supported Countries
- Brazil: Validates CPF, CNPJ, phone numbers, bank account details, vehicle plates, and more.
- Canada: Validates SIN, phone numbers, and driver's licenses.
- USA: Validates SSN, phone numbers, passports, and driver's licenses.
Key Functionalities
- Personal data validation (e.g., CPF, SIN, SSN, email, name).
- Banking data validation (e.g., IBAN, SWIFT, bank codes).
- Vehicle data validation (e.g., plates, VIN, RENAVAM).
- Corporate data validation (e.g., CNPJ, state registration, NIRE).
- Easy configuration and modular structure.
Installation
Using Composer
Requirements
- PHP 7.4 or higher
- Composer
Integration with Laravel
Service Provider Registration (Optional)
If needed, you can create a service provider to encapsulate the library.
-
Create a Service Provider
-
Register the Library in the Provider In the generated
CountryValidationsServiceProvider
: -
Add the Provider in
config/app.php
- Using the Library in Controllers
Usage
General Setup
Examples
Brazil
Canada
USA
Validations Available
Brazil
- Personal: CPF, RG, CNS, email, phone, birth date, full name, PIS/PASEP, CNH, voter registration.
- Company: CNPJ, corporate name, corporate phone, state registration, NIRE.
- Bank: Bank code, branch code, account number, boleto line, SWIFT, IBAN, BIN.
- Vehicle: Plate (standard and Mercosul), RENAVAM, VIN (chassis), vehicle category.
- Currency: Brazilian Real format, exchange rates, positive amounts, limits, numeric format, percentages.
Canada
- Personal: SIN, email, phone, birth date, full name, passport, driver's license (by province).
USA
- Personal: SSN, email, phone, birth date, full name, passport, driver's license (by state).
Testing
Run the tests using PHPUnit:
License
This library is open-sourced software licensed under the MIT license.