{"id":20128947,"url":"https://github.com/intervention/validation","last_synced_at":"2026-02-28T08:54:37.909Z","repository":{"id":6518871,"uuid":"7759762","full_name":"Intervention/validation","owner":"Intervention","description":"Missing Laravel Validation Rules","archived":false,"fork":false,"pushed_at":"2025-03-31T13:52:57.000Z","size":515,"stargazers_count":645,"open_issues_count":1,"forks_count":68,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-10T22:17:35.885Z","etag":null,"topics":["laravel","php","validation"],"latest_commit_sha":null,"homepage":"https://validation.intervention.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Intervention.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Intervention"],"ko_fi":"interventionphp","custom":"https://paypal.me/interventionio"}},"created_at":"2013-01-22T19:42:37.000Z","updated_at":"2025-04-09T06:36:32.000Z","dependencies_parsed_at":"2024-01-18T18:29:34.734Z","dependency_job_id":"e703c551-71ac-4d6c-b217-35920efeae32","html_url":"https://github.com/Intervention/validation","commit_stats":{"total_commits":293,"total_committers":32,"mean_commits":9.15625,"dds":0.2866894197952219,"last_synced_commit":"0f6aba7b1bc6191a357ec7f9a934a8966c06d65d"},"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fvalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fvalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fvalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fvalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intervention","download_url":"https://codeload.github.com/Intervention/validation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254044224,"owners_count":22005104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["laravel","php","validation"],"created_at":"2024-11-13T20:30:44.978Z","updated_at":"2026-02-28T08:54:37.856Z","avatar_url":"https://github.com/Intervention.png","language":"PHP","funding_links":["https://github.com/sponsors/Intervention","https://ko-fi.com/interventionphp","https://paypal.me/interventionio"],"categories":[],"sub_categories":[],"readme":"# Intervention Validation\n\nIntervention Validation is an extension library for Laravel's own validation\nsystem. The package adds rules to validate data like IBAN, BIC, ISBN,\ncreditcard numbers and more.\n\n[![Latest Version](https://img.shields.io/packagist/v/intervention/validation.svg)](https://packagist.org/packages/intervention/validation)\n[![Tests](https://github.com/Intervention/validation/actions/workflows/build.yml/badge.svg)](https://github.com/Intervention/validation/actions/workflows/build.yml)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/intervention/validation.svg)](https://packagist.org/packages/intervention/validation/stats)\n[![Support me on Ko-fi](https://raw.githubusercontent.com/Intervention/validation/main/.github/images/support.svg)](https://ko-fi.com/interventionphp)\n\n## Installation\n\nYou can install this package quick and easy with Composer.\n\nRequire the package via Composer:\n\n    $ composer require intervention/validation\n\n## Laravel integration\n\nThe Validation library is built to work with the Laravel Framework (\u003e=10). It\ncomes with a service provider, which will be discovered automatically and\nregisters the validation rules into your installation. The package provides 30\nadditional validation rules including multi language error messages, which can\nbe used like Laravel's own validation rules.\n\n```php\nuse Illuminate\\Support\\Facades\\Validator;\nuse Intervention\\Validation\\Rules\\Creditcard;\nuse Intervention\\Validation\\Rules\\Hexadecimalcolor;\nuse Intervention\\Validation\\Rules\\Username;\n\n$validator = Validator::make($request-\u003eall(), [\n    'color' =\u003e new Hexadecimalcolor([3, 6]), // pass rule as object\n    'number' =\u003e ['required', 'creditcard'], // or pass rule as string\n    'name' =\u003e 'required|min:3|max:20|username', // combining rules works as well\n]);\n```\n\n### Changing the error messages:\n\nAdd the corresponding key to `/resources/lang/\u003clanguage\u003e/validation.php` like this:\n\n```php\n// example\n'iban' =\u003e 'Please enter IBAN number!',\n```\nOr add your custom messages directly to the validator like [described in the docs](https://laravel.com/docs/10.x/validation#manual-customizing-the-error-messages).\n\n## Available Rules\n\nThe following validation rules are available with this package.\n\n### Austrian insurance Number (austrian social security number)\n\nThe field under validation must be an [Austrian insurance number](https://de.wikipedia.org/wiki/Sozialversicherungsnummer#%C3%96sterreich)\n\n    public Intervention\\Validation\\Rules\\AustrianInsuranceNumber::__construct()\n\n### Base64 encoded string\n\nThe field under validation must be [Base64 encoded](https://en.wikipedia.org/wiki/Base64).\n\n    public Intervention\\Validation\\Rules\\Base64::__construct()\n\n### Business Identifier Code (BIC)\n\nChecks for a valid [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC).\n\n    public Intervention\\Validation\\Rules\\Bic::__construct()\n\n### Camel case string\n\nThe field under validation must be a formatted in [Camel case](https://en.wikipedia.org/wiki/Camel_case).\n\n    public Intervention\\Validation\\Rules\\Camelcase::__construct()\n\n### Classless Inter-Domain Routing (CIDR)\n\nCheck if the value is a [Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (CIDR).\n\n    public Intervention\\Validation\\Rules\\Cidr::__construct()\n\n### Creditcard Number\n\nThe field under validation must be a valid [creditcard number](https://en.wikipedia.org/wiki/Payment_card_number).\n\n    public Intervention\\Validation\\Rules\\Creditcard::__construct()\n\n### Data URI scheme\n\nThe field under validation must be a valid [Data URI](https://en.wikipedia.org/wiki/Data_URI_scheme).\n\n    public Intervention\\Validation\\Rules\\DataUri::__construct(?array $media_types = null)\n\n### Domain name\n\nThe field under validation must be a well formed [domainname](https://en.wikipedia.org/wiki/Domain_name).\n\n    public Intervention\\Validation\\Rules\\Domainname::__construct()\n\n### European Article Number (EAN)\n\nChecks for a valid [European Article Number](https://en.wikipedia.org/wiki/International_Article_Number).\n\n    public Intervention\\Validation\\Rules\\Ean::__construct(array $lengths = [8, 13])\n\n#### Parameters\n\n**length**\n\nOptional integer length (8 or 13) to check only for EAN-8 or EAN-13.\n\n### Global Release Identifier (GRid)\n\nThe field under validation must be a [Global Release Identifier](https://en.wikipedia.org/wiki/Global_Release_Identifier).\n\n    public Intervention\\Validation\\Rules\\Grid::__construct()\n\n### Global Trade Item Number (GTIN)\n\nChecks for a valid [Global Trade Item Number](https://en.wikipedia.org/wiki/Global_Trade_Item_Number).\n\n    public Intervention\\Validation\\Rules\\Gtin::__construct(array $lengths = [8, 12, 13, 14])\n\n#### Parameters\n\n**length**\n\nOptional array of allowed lengths to check only for certain types (GTIN-8, GTIN-12, GTIN-13 or GTIN-14).\n\n### Hexadecimal color code\n\nThe field under validation must be a valid [hexadecimal color code](https://en.wikipedia.org/wiki/Web_colors).\n\n    public Intervention\\Validation\\Rules\\Hexadecimalcolor::__construct(array $lengths = [3, 4, 6, 8])\n\n#### Parameters\n\n**length**\n\nOptional length as integer to check only for shorthand (3 or 4 characters) or full hexadecimal (6 or 8 characters) form.\n\n### HSL Color\n\nThe field under validation must be a valid [HSL color code](https://en.wikipedia.org/wiki/HSL_and_HSV).\n\n    public Intervention\\Validation\\Rules\\Hslcolor::__construct()\n\n### HSV Color\n\nThe field under validation must be a valid [HSV/HSB color code](https://en.wikipedia.org/wiki/HSL_and_HSV).\n\n    public Intervention\\Validation\\Rules\\Hsvcolor::__construct()\n\n### Text without HTML\n\nThe field under validation must be free of any html code.\n\n    public Intervention\\Validation\\Rules\\HtmlClean::__construct()\n\n### International Bank Account Number (IBAN)\n\nChecks for a valid [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).\n\n    public Intervention\\Validation\\Rules\\Iban::__construct()\n\n### International Mobile Equipment Identity (IMEI)\n\nThe field under validation must be a [International Mobile Equipment Identity](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) (IMEI).\n\n    public Intervention\\Validation\\Rules\\Imei::__construct()\n\n### International Standard Book Number (ISBN)\n\nThe field under validation must be a valid [International Standard Book Number](https://en.wikipedia.org/wiki/International_Standard_Book_Number) (ISBN).\n\n    public Intervention\\Validation\\Rules\\Isbn::__construct(array $lengths = [10, 13])\n\n#### Parameters\n\n**length**\n\nOptional length parameter as integer to check only for ISBN-10 or ISBN-13.\n\n### International Securities Identification Number (ISIN)\n\nChecks for a valid [International Securities Identification Number](https://en.wikipedia.org/wiki/International_Securities_Identification_Number) (ISIN).\n\n    public Intervention\\Validation\\Rules\\Isin::__construct()\n\n### International Standard Serial Number (ISSN)\n\nChecks for a valid [International Standard Serial Number](https://en.wikipedia.org/wiki/International_Standard_Serial_Number) (ISSN).\n\n    public Intervention\\Validation\\Rules\\Issn::__construct()\n\n### JSON Web Token (JWT)\n\nThe given value must be a in format of a [JSON Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token).\n\n    public Intervention\\Validation\\Rules\\Jwt::__construct()\n\n### Kebab case string\n\nThe given value must be formatted in [Kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n\n    public Intervention\\Validation\\Rules\\Kebabcase::__construct()\n\n### Latitude\n\nChecks for a valid geographic [Latitude](https://en.wikipedia.org/wiki/Latitude).\n\n    public Intervention\\Validation\\Rules\\Latitude::__construct()\n\n### Longitude\n\nChecks for a valid geographic [Longitude](https://en.wikipedia.org/wiki/Longitude).\n\n    public Intervention\\Validation\\Rules\\Longitude::__construct()\n\n### LatLng\n\nChecks for a valid geographic comma separated pair of a [Latitude](https://en.wikipedia.org/wiki/Latitude) and a [Longitude](https://en.wikipedia.org/wiki/Longitude).\n\n    public Intervention\\Validation\\Rules\\LatLng::__construct()\n\n### Lower case string\n\nThe given value must be all lower case letters.\n\n    public Intervention\\Validation\\Rules\\Lowercase::__construct()\n\n### Luhn algorithm\n\nThe given value must verify against its included [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) check digit.\n\n    public Intervention\\Validation\\Rules\\Luhn::__construct()\n\n### Media (MIME) type\n\nChecks for a valid [Mime Type](https://en.wikipedia.org/wiki/Media_type) (Media type).\n\n    public Intervention\\Validation\\Rules\\MimeType::__construct()\n\n### Postal Code\n\nThe field under validation must be a [postal code](https://en.wikipedia.org/wiki/Postal_code) of the given country.\n\n    public Intervention\\Validation\\Rules\\Postalcode::__construct(array $countrycodes = [])\n\n#### Parameters\n\n**countrycode**\n\nCountry code in [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n\n### Postal Code (static instantiation)\n\n    public static Intervention\\Validation\\Rules\\Postalcode::countrycode(array $countrycodes): Postalcode\n\n#### Parameters\n\n**countrycode**\n\nCountry code in [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n\n### Postal Code (static instantiation with reference)\n\n    public static Intervention\\Validation\\Rules\\Postalcode::reference(string $reference): Postalcode\n\n#### Parameters\n\n**reference**\n\nReference key to get [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) country code from other data in validator.\n\n### Semantic Version Number\n\nThe field under validation must be a valid version numbers using [Semantic Versioning](https://semver.org/).\n\n    public Intervention\\Validation\\Rules\\SemVer::__construct()\n\n### SEO-friendly short text (Slug)\n\nThe field under validation must be a user- and [SEO-friendly short text](https://en.wikipedia.org/wiki/Clean_URL#Slug).\n\n    public Intervention\\Validation\\Rules\\Slug::__construct()\n\n### Snake case string\n\nThe field under validation must formatted as [Snake case](https://en.wikipedia.org/wiki/Snake_case) text.\n\n    public Intervention\\Validation\\Rules\\Snakecase::__construct()\n\n### Title case string\n\nThe field under validation must formatted in [Title case](https://en.wikipedia.org/wiki/Title_case).\n\n    public Intervention\\Validation\\Rules\\Titlecase::__construct()\n\n### Universally Unique Lexicographically Sortable Identifier (ULID)\n\nThe field under validation must be a valid [Universally Unique Lexicographically Sortable Identifier](https://github.com/ulid/spec).\n\n    public Intervention\\Validation\\Rules\\Ulid::__construct()\n\n### Upper case string\n\nThe field under validation must be all upper case.\n\n    public Intervention\\Validation\\Rules\\Uppercase::__construct()\n\n### Username\n\nThe field under validation must be a valid username. Consisting of\nalpha-numeric characters, underscores, minus and starting with a alphabetic\ncharacter. Multiple underscore and minus chars are not allowed. Underscore and\nminus chars are not allowed at the beginning or end.\n\n    public Intervention\\Validation\\Rules\\Username::__construct()\n\n## Development \u0026 Testing\n\nWith this package comes a Docker image to build a test suite container. To\nbuild this container you have to have Docker installed on your system. You can\nrun all tests with this command.\n\n    $ docker-compose run --rm --build tests\n\n## Authors\n\nThis library is developed and maintained by [Oliver Vogel](https://intervention.io)\n\nThanks to the community of [contributors](https://github.com/Intervention/validation/graphs/contributors) who have helped to improve this project.\n\n## License\n\nIntervention Validation is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintervention%2Fvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintervention%2Fvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintervention%2Fvalidation/lists"}