{"id":18674280,"url":"https://github.com/simtabi/ensue","last_synced_at":"2026-04-29T10:34:42.738Z","repository":{"id":83938212,"uuid":"341707134","full_name":"simtabi/ensue","owner":"simtabi","description":"Additional Validator Functions for the Laravel Framework","archived":false,"fork":false,"pushed_at":"2021-04-18T03:06:21.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-18T11:07:34.930Z","etag":null,"topics":["laravel","laravelvalidation","validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simtabi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-02-23T22:23:56.000Z","updated_at":"2022-03-26T19:56:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e522e86-402e-45b3-9cbb-a2573f29f6de","html_url":"https://github.com/simtabi/ensue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simtabi/ensue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fensue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fensue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fensue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fensue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simtabi","download_url":"https://codeload.github.com/simtabi/ensue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fensue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32422090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["laravel","laravelvalidation","validation"],"created_at":"2024-11-07T09:18:18.014Z","updated_at":"2026-04-29T10:34:42.730Z","avatar_url":"https://github.com/simtabi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ensue Validation\n\nEnsue Validation is an extension library for Laravel's own validation system. The package adds rules to validate data like IBAN, BIC, ISBN, creditcard numbers and more.\n\n[![Latest Version](https://img.shields.io/packagist/v/simtabi/ensue.svg)](https://packagist.org/packages/simtabi/ensue)\n![build](https://github.com/Simtabi/ensue/workflows/build/badge.svg)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/simtabi/ensue.svg)](https://packagist.org/packages/simtabi/ensue/stats)\n\n\nWith inspiration from ``https://github.com/Intervention/validation``\n\n## Installation\n\nYou can install this package quick and easy with Composer.\n\nRequire the package via Composer:\n\n    $ composer require ensue/validation\n\n### Laravel integration (optional)\n\nThe Validation library is built to work with the Laravel Framework (\u003e=5.5). It comes with a service provider, which will be discovered automatically and registers the validation rules into your installation.\n\n## Usage\n\n```php\nuse Simtabi\\Ensue\\Validation\\Validator;\nuse Simtabi\\Ensue\\Validation\\Rules\\HexColor;\nuse Simtabi\\Ensue\\Validation\\Exception\\EnsueException;\n\n// create validator (for HexColor)\n$validator = new Validator(new HexColor);\n\n// validate against given values\n$valid = $validator-\u003evalidate('#ccc'); // true\n$valid = $validator-\u003evalidate('www'); // false\n\n// change the validation rule\n$validator-\u003esetRule(new Domainname);\n\n// now validate new rule domainname\n$valid = $validator-\u003evalidate('foo.com'); // true\n$valid = $validator-\u003evalidate('?'); // false\n\n// validator can also throw exceptions on invalid data. \n// just call assert() instead of validate().\ntry {\n    $validator-\u003eassert('foobar');\n} catch (EnsueException $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n## Static Usage\n\n```php\nuse Simtabi\\Ensue\\Validation\\Validator;\nuse Simtabi\\Ensue\\Validation\\Rules\\HexColor;\nuse Simtabi\\Ensue\\Validation\\Exception\\EnsueException;\n\n// create validator statically\n$valid = Validator::make(new HexColor)-\u003evalidate('ccc'); // true\n$valid = Validator::make(new HexColor)-\u003evalidate('#www'); // false\n\n// throw exceptions on invalid data instead of returning boolean\ntry {\n    Validator::make(new HexColor)-\u003eassert('www');\n} catch (EnsueException $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n## Static dynamic call Usage\n\n```php\nuse Simtabi\\Ensue\\Validation\\Validator;\nuse Simtabi\\Ensue\\Validation\\Rules\\HexColor;\nuse Simtabi\\Ensue\\Validation\\Exception\\EnsueException;\n\n// call validation rule directly via static method\n$valid = Validator::isHexColor('#ccc'); // true\n$valid = Validator::isHexColor('#www'); // false\n\n// throw exceptions on invalid data\ntry {\n    Validator::assertHexColor('foo');\n} catch (EnsueException $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n## Usage with Laravel\n\nThe installed package provides additional `validation rules` including their error messages.\n\n```php\nuse Illuminate\\Support\\Facades\\Validator;\n\n$validator = Validator::make($request-\u003eall(), [\n    'color' =\u003e 'required|hexcolor',\n    'number' =\u003e 'iban',\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```\n\nOr add your custom messages directly to the validator like [described in the docs](https://laravel.com/docs/6.x/validation#custom-error-messages).\n\n## Available Rules\n\nThe following validation rules are available.\n\n### base64 (Simtabi\\Ensue\\Validation\\Rules\\Base64)\n\nChecks if given value is [Base64 encoded](https://en.wikipedia.org/wiki/Base64).\n\n### bic (Simtabi\\Ensue\\Validation\\Rules\\Bic)\n\nChecks for a valid [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC).\n\n### camelcase (Simtabi\\Ensue\\Validation\\Rules\\CamelCase)\n\nThe given field must be a formated in [Camel case](https://en.wikipedia.org/wiki/Camel_case).\n\n### cidr (Simtabi\\Ensue\\Validation\\Rules\\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### creditcard (Simtabi\\Ensue\\Validation\\Rules\\Creditcard)\n\nThe given field must be a valid [creditcard number](https://en.wikipedia.org/wiki/Payment_card_number).\n\n### domainname (Simtabi\\Ensue\\Validation\\Rules\\Domainname)\n\nThe given field must be a well formed [domainname](https://en.wikipedia.org/wiki/Domain_name).\n\n### hexcolor (Simtabi\\Ensue\\Validation\\Rules\\HexColor)\n\nThe field under validation must be a valid [hexadecimal color code](https://en.wikipedia.org/wiki/Web_colors).\n\n### htmlclean (Simtabi\\Ensue\\Validation\\Rules\\HtmlClean)\n\nThe field under validation must be free of any html code.\n\n### iban (Simtabi\\Ensue\\Validation\\Rules\\Iban)\n\nChecks for a valid [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).\n\n### imei (Simtabi\\Ensue\\Validation\\Rules\\Imei)\n\nThe given field must be a [International Mobile Equipment Identity](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) (IMEI).\n\n### isbn (Simtabi\\Ensue\\Validation\\Rules\\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### isin (Simtabi\\Ensue\\Validation\\Rules\\Isin)\n\nChecks for a valid [International Securities Identification Number](https://en.wikipedia.org/wiki/International_Securities_Identification_Number) (ISIN).\n\n### issn (Simtabi\\Ensue\\Validation\\Rules\\Issn)\n\nChecks for a valid [International Standard Serial Number](https://en.wikipedia.org/wiki/International_Standard_Serial_Number) (ISSN).\n\n### jwt (Simtabi\\Ensue\\Validation\\Rules\\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### kebabcase (Simtabi\\Ensue\\Validation\\Rules\\KebabCase)\n\nThe given value must be formated in [Kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n\n### lowercase (Simtabi\\Ensue\\Validation\\Rules\\LowerCase)\n\nThe given value must be all lower case letters.\n\n### luhn (Simtabi\\Ensue\\Validation\\Rules\\Luhn)\n\nThe given value must verify against its included [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) check digit.\n\n### macaddress (Simtabi\\Ensue\\Validation\\Rules\\MacAddress)\n\nThe field under validation must be a [media access control address](https://en.wikipedia.org/wiki/MAC_address) (MAC address).\n\n### semver (Simtabi\\Ensue\\Validation\\Rules\\SemVer)\n\nThe given field must be a valid version numbers using [Semantic Versioning](https://semver.org/).\n\n### slug (Simtabi\\Ensue\\Validation\\Rules\\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### snakecase (Simtabi\\Ensue\\Validation\\Rules\\SnakeCase)\n\nThe field under validation must formated as [Snake case](https://en.wikipedia.org/wiki/Snake_case) text.\n\n### titlecase (Simtabi\\Ensue\\Validation\\Rules\\TitleCase)\n\nThe field under validation must formated in [Title case](https://en.wikipedia.org/wiki/Title_case).\n\n### uppercase (Simtabi\\Ensue\\Validation\\Rules\\UpperCase)\n\nThe field under validation must be all upper case.\n\n### username (Simtabi\\Ensue\\Validation\\Rules\\Username)\n\nThe field under validation must be a valid username with a minimum of 3 characters and maximum of 20 characters. Consisting of alpha-numeric characters, underscores, minus and starting with a alphabetic character. Multiple underscore and minus chars are not allowed. Underscore and minus chars are not allowed at the beginning or end.\n\n\nAn extension to Laravel's Validator class that provides some additional validation rules.\n\n## Installation\nYou can install the package via composer:\n\n```\ncomposer require mallardduck/extended-validator-laravel\n```\nJust require the project and Laravel's Service Provider Auto-discovery will do the rest.  \nAll the new rules will be automatically registered for use without any configuration.\n\n## Requirements\n* PHP 7.3.x\n* Laravel 8.x\n\n## Available Rules\n* [`PublicIp`](#publicip)\n* [`PublicIpv4`](#publicipv4)\n* [`PublicIpv6`](#publicipv6)\n* [`UnfilledIf`](#unfilledif)\n* [`UnfilledWith`](#unfilledwith)\n* [`UnfilledWIthAll`](#unfilledwithall)\n\n### `PublicIp`\nDetermine if the field under validation is a valid public IP address.  \nJust like Laravel's `ip` rule, but IPs cannot be within private or reserved ranges.\n\n```\n$rules = [\n    'ip' =\u003e 'required|public_ip',\n];\n```\n\n### `PublicIpv4`\nDetermine if the field under validation is a valid public IPv4 address.  \nJust like Laravel's `ipv4` rule, but IPs cannot be within private or reserved ranges.\n\n```\n$rules = [\n    'ip' =\u003e 'required|public_ipv4',\n];\n```\n\n### `PublicIpv6`\nDetermine if the field under validation is a valid public IPv6 address.  \nJust like Laravel's `ipv6` rule, but IPs cannot be within private or reserved ranges.\n\n```\n$rules = [\n    'ip' =\u003e 'required|public_ipv4',\n];\n```\n\n### `UnfilledIf`\nThe field under validation must not be present if the anotherfield field is equal to any given value.  \nThink of it as the opposite of Larave's `required_if`.\n\n```\n$rules = [\n    'shape'  =\u003e 'required',\n    'size'   =\u003e 'unfilled_if:shape,rect',\n    'height' =\u003e 'unfilled_if:shape,square',\n    'width'  =\u003e 'unfilled_if:shape,square',\n];\n```\n\n### `UnfilledWith`\nThe field under validation must not be present only if any of the other specified fields are present.  \nThink of it as the opposite of Larave's `required_with`.\n\n```\n$rules = [\n    'name' =\u003e 'sometimes',\n    'first_name' =\u003e 'unfilled_with:name',\n    'last_name' =\u003e 'unfilled_with:name'\n];\n```\n\n### `UnfilledWIthAll`\nThe field under validation must not be present only if all the other specified fields are present.  \nThink of it as the opposite of Larave's `required_with_all`.\n\n```\n$rules = [\n    'name' =\u003e 'unfilled_with_all:first_name,middle_name,last_name',\n    'first_name' =\u003e 'sometimes',\n    'middle_name' =\u003e 'sometimes',\n    'last_name' =\u003e 'sometimes'\n];\n```\n\n## License\n\nEnsue Validation is licensed under the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Fensue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimtabi%2Fensue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Fensue/lists"}