Download the PHP package pixelpeter/laravel5-isocodes-validation without Composer
On this page you can find all versions of the php package pixelpeter/laravel5-isocodes-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pixelpeter/laravel5-isocodes-validation
More information about pixelpeter/laravel5-isocodes-validation
Files in pixelpeter/laravel5-isocodes-validation
Package laravel5-isocodes-validation
Short Description Laravel 5 wrapper for the IsoCodes Validation library from ronanguilloux
License GPL-3.0-or-later
Homepage https://github.com/pixelpeter/laravel5-isocodes-validation
Informations about the package laravel5-isocodes-validation
Laravel 5 IsoCodes Validation
A simple Laravel 5 wrapper for the IsoCodes Validation library from ronanguilloux.
For a Laravel 8 compatible version please use https://github.com/pixelpeter/laravel-isocodes-validation
Installation
Step 1: Install Through Composer
Step 2: Add the Service Provider
(not needed starting with v2.x because of auto discovery)
Add the service provider in app/config/app.php
Usage
Simple examples
Examples with reference parameter
Some rules need a reference to be validated against (e.g. country
for zipcode
).
Just pass the name of the field holding the reference to the rule.
Example with arrays and dot notation
(added in v3.x)
As suggested by @otr-tomek I've added support for all validation methods using arrays in dot notation as an input.
Validation error messages
Error messages can contain the name and value of the field and the value of the reference
More Examples
Refer to IsoCodes Validation library for more examples and documentation.
Testing
Run the tests with:
License
GNU General Public License v3.0 only. Please see License File for more information.