{"id":36981940,"url":"https://github.com/thunken/laravel5-isocodes-validation","last_synced_at":"2026-01-13T22:51:49.160Z","repository":{"id":57069371,"uuid":"235563406","full_name":"thunken/laravel5-isocodes-validation","owner":"thunken","description":"Laravel 5 wrapper for the IsoCodes Validation library from ronanguilloux","archived":true,"fork":true,"pushed_at":"2020-01-22T12:18:11.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-27T16:37:48.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"pixelpeter/laravel5-isocodes-validation","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thunken.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-22T11:54:18.000Z","updated_at":"2023-01-28T02:33:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thunken/laravel5-isocodes-validation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thunken/laravel5-isocodes-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunken%2Flaravel5-isocodes-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunken%2Flaravel5-isocodes-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunken%2Flaravel5-isocodes-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunken%2Flaravel5-isocodes-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunken","download_url":"https://codeload.github.com/thunken/laravel5-isocodes-validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunken%2Flaravel5-isocodes-validation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-13T22:51:49.058Z","updated_at":"2026-01-13T22:51:49.145Z","avatar_url":"https://github.com/thunken.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel 5 IsoCodes Validation\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/thunken/laravel5-isocodes-validation.svg?style=flat-square\u0026t=123)](https://packagist.org/packages/thunken/laravel5-isocodes-validation)\n[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Travis Build](https://img.shields.io/travis/thunken/laravel5-isocodes-validation/master.svg?style=flat-square)](https://travis-ci.org/thunken/laravel5-isocodes-validation)\n[![Scrutinizer Quality](https://img.shields.io/scrutinizer/g/thunken/laravel5-isocodes-validation.svg?style=flat-square)](https://scrutinizer-ci.com/g/thunken/laravel5-isocodes-validation)\n[![Scrutinizer Build](https://img.shields.io/scrutinizer/build/g/thunken/laravel5-isocodes-validation.svg?style=flat-square)](https://scrutinizer-ci.com/g/thunken/laravel5-isocodes-validation)\n[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/32635b20-a120-46de-a1af-4ce876bdcfbe.svg?style=flat-square)](https://insight.sensiolabs.com/projects/32635b20-a120-46de-a1af-4ce876bdcfbe)\n[![Total Downloads](https://img.shields.io/packagist/dt/thunken/laravel5-isocodes-validation.svg?style=flat-square)](https://packagist.org/packages/thunken/laravel5-isocodes-validation)\n[![Coverage Status](https://coveralls.io/repos/github/thunken/laravel5-isocodes-validation/badge.svg?branch=master)](https://coveralls.io/github/thunken/laravel5-isocodes-validation?branch=master)\n\nA simple Laravel 5 wrapper for the [IsoCodes Validation library](https://github.com/ronanguilloux/IsoCodes) from ronanguilloux.\n\n## Installation\n\n### Step 1: Install Through Composer\n``` bash\ncomposer require thunken/laravel5-isocodes-validation\n```\n\n### Step 2: Add the Service Provider\n*(not needed starting with v2.x because of auto discovery)*\n\nAdd the service provider in `app/config/app.php`\n```php\n'provider' =\u003e [\n    ...\n    Thunken\\IsoCodesValidation\\IsoCodesValidationServiceProvider::class,\n    ...\n];\n```\n\n## Usage\n\n### Simple examples\n\n```php\n// Checking out your e-commerce shopping cart?\n$payload = [\n    'creditcard' =\u003e '12345679123456'\n];\n$rules = [\n    'creditcard' =\u003e 'creditcard'\n];\n\n$validator = Validator::make($payload, $rules);\n```\n\n### Examples with reference parameter\nSome rules need a reference to be validated against (e.g. `country` for `zipcode`).\n\nJust pass the name of the field holding the reference to the rule.\n\n```php\n// Sending letters to the Labrador Islands ?\n$payload = [\n    'zipcode' =\u003e 'A0A 1A0',\n    'country' =\u003e 'CA'\n];\n$rules = [\n    'zipcode' =\u003e 'zipcode:country'\n];\n\n$validator = Validator::make($payload, $rules);\n\n// Publishing books?\n$payload = [\n    'isbn' =\u003e '2-2110-4199-X',\n    'isbntype' =\u003e 13\n];\n$rules = [\n    'zipcode' =\u003e 'isbn:isbntype'\n];\n\n$validator = Validator::make($payload, $rules);\n```\n\n### Example with arrays and dot notation\n*(added in v3.x)*\n\nAs suggested by @otr-tomek I've added support for all validation methods using arrays in dot notation as an input.\n\n```php\n$payload = [\n    'data' =\u003e [\n        [\n            'country' =\u003e 'DE',\n            'zipcode' =\u003e 63741\n        ],\n        [\n            'country' =\u003e 'AT',\n            'zipcode' =\u003e 1180\n        ]\n  ] \n];\n\n$validator = Validator::make($payload, [\n    'data.*.zipcode' =\u003e 'zipcode:data.*.country'\n]);\n```\n\n### Validation error messages\nError messages can contain the name and value of the field and the value of the reference\n```php\n$payload = [\n    'phonenumber' =\u003e 'invalid',\n    'country' =\u003e 'GB'\n];\n$rules = [\n    'phonenumber' =\u003e 'phonenumber:country'\n];\n\n$validator = Validator::make($payload, $rules);\n\nprint $validator-\u003eerrors()-\u003efirst(); // The value \"invalid\" of phonenumber is not valid for \"GB\".\n```\n\n### More Examples\nRefer to [IsoCodes Validation library](https://github.com/ronanguilloux/IsoCodes) for more examples and documentation.\n\n## Testing\nRun the tests with:\n```bash\nvendor/bin/phpunit\n```\n\n## License\n\nGNU General Public License v3.0 only. Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunken%2Flaravel5-isocodes-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunken%2Flaravel5-isocodes-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunken%2Flaravel5-isocodes-validation/lists"}