{"id":18674260,"url":"https://github.com/simtabi/enekia","last_synced_at":"2025-07-09T10:38:15.770Z","repository":{"id":83938210,"uuid":"567831604","full_name":"simtabi/enekia","owner":"simtabi","description":"Additional validation rules for the Laravel framework","archived":false,"fork":false,"pushed_at":"2023-02-26T13:57:10.000Z","size":1267,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T11:07:30.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/simtabi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-11-18T17:25:27.000Z","updated_at":"2022-11-18T17:26:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9a8d667-50ff-4df3-b43b-809501a66987","html_url":"https://github.com/simtabi/enekia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simtabi/enekia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fenekia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fenekia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fenekia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fenekia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simtabi","download_url":"https://codeload.github.com/simtabi/enekia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Fenekia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264441544,"owners_count":23608905,"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":[],"created_at":"2024-11-07T09:18:13.160Z","updated_at":"2025-07-09T10:38:15.757Z","avatar_url":"https://github.com/simtabi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/simtabi\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://avatars1.githubusercontent.com/u/47185924\" height=\"100px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eEnekia: Laravel Validation Rules\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n# Intervention Validation\n\nIntervention 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/intervention/validation.svg)](https://packagist.org/packages/intervention/validation)\n![build](https://github.com/Intervention/validation/workflows/build/badge.svg)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/intervention/validation.svg)](https://packagist.org/packages/intervention/validation/stats)\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=7). It comes with a service provider, which will be discovered automatically and registers the validation rules into your installation. The package provides 30 additional validation rules including error messages, which can be used like Laravel's own validation rules.\n\n```php\nuse Illuminate\\Support\\Facades\\Validator;\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\CreditCard;\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\HexColor;\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Username;\n\n$validator = Validator::make($request-\u003eall(), [\n    'color' =\u003e new HexColor(3), // 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/8.x/validation#manual-customizing-the-error-messages).\n\n## Standalone usage\n\nIt is also possible to use this library without the Laravel framework. You won't have the Laravel facades available, so make sure to use `Simtabi\\Enekia\\Validator` for your calls.\n\n```php\nuse Simtabi\\Enekia\\Validator;\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\CreditCard;\nuse Simtabi\\Enekia\\Laravel\\Exceptions\\EnekiaException;\n\n// use static factory method to create laravel validator\n$validator = Validator::make($request-\u003eall(), [\n    'ccnumber' =\u003e new CreditCard(),\n    'iban' =\u003e ['required', 'iban'],\n    'color' =\u003e 'required|hexcolor:3',\n]);\n\n// validate single values by calling static methods\n$result = Validator::isHexcolor('foobar'); // false\n$result = Validator::isHexcolor('#ccc'); // true\n$result = Validator::isBic('foo'); // false\n\n// assert single values\ntry {\n    Validator::assertHexcolor('foobar');\n} catch (EnekiaException $e) {\n    $message = $e-\u003egetMessage();\n}\n```\n\n# Available Rules\n\nThe following validation rules are available with this package.\n\n## Base64 encoded string\n\nThe field under validation must be [Base64 encoded](https://en.wikipedia.org/wiki/Base64).\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Bic::__construct()\n\n## Camel case string\n\nThe field under validation must be a formated in [Camel case](https://en.wikipedia.org/wiki/Camel_case).\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\DataUri::__construct()\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Ean::__construct(?int $length = null)\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 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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Gtin::__construct(?int $length = null)\n\n#### Parameters\n\n**length**\n\nOptional integer length 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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\HexColor::__construct(?int $length = null)\n\n#### Parameters\n\n**length**\n\nOptional length as integer to check only for shorthand (3 characters) or full hexadecimal (6 characters) form.\n\n## Text without HTML\n\nThe field under validation must be free of any html code.\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Isbn::__construct(?int $length = null)\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Jwt::__construct()\n\n## Kebab case string\n\nThe given value must be formated in [Kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Kebabcase::__construct()\n\n## Lower case string \n\nThe given value must be all lower case letters.\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Postalcode::__construct(string $countrycode)\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Postalcode::countrycode(string $countrycode): 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 callback)\n\n    public static Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Postalcode::resolve(callable $callback): Postalcode\n\n#### Parameters\n\n**callback**\n\nCallback to resolve [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) country code from other source.\n\n### Postal Code (static instantiation with reference)\n\n    public static Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Slug::__construct()\n\n## Snake case string\n\nThe field under validation must formated as [Snake case](https://en.wikipedia.org/wiki/Snake_case) text.\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Snakecase::__construct()\n\n## Title case string\n\nThe field under validation must formated in [Title case](https://en.wikipedia.org/wiki/Title_case).\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\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 Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Ulid::__construct()\n\n## Upper case string\n\nThe field under validation must be all upper case.\n\n    public Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Uppercase::__construct()\n\n## Username\n\nThe field under validation must be a valid username. 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    public Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Username::__construct()\n\n\n\n### `AuthorizedOnModelAction`\n\nDetermine if the user is authorized to perform an ability on an instance of the given model. The id of the model is the field under validation\n\nConsider the following policy:\n\n```php\nclass ModelPolicy\n{\n    use HandlesAuthorization;\n\n    public function edit(User $user, Model $model): bool\n    {\n        return $model-\u003euser-\u003eid === $user-\u003eid;\n    }\n}\n```\n\nThis validation rule will pass if the id of the logged in user matches the `user_id` on `TestModel` who's it is in the `model_id` key of the request.\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\AuthorizedOnModelAction;\n\npublic function rules()\n{\n    return [\n        'model_id' =\u003e [new AuthorizedOnModelAction('edit', TestModel::class)],\n    ];\n}\n```\n\nOptionally, you can provide an authentication guard as the third parameter.\n\n```php\nnew AuthorizedOnModelAction('edit', TestModel::class, 'guard-name')\n```\n\n#### Model resolution\nIf you have implemented the `getRouteKeyName` method in your model, it will be used to resolve the model instance. For further information see [Customizing The Default Key Name](https://laravel.com/docs/7.x/routing)\n\n### `CountryCode`\n\nDetermine if the field under validation is a valid [2 letter ISO3166 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Current_codes) (example of valid country codes: `GB`, `DK`, `NL`).\n\n**Note** that this rule require the package [`league/iso3166`](https://github.com/thephpleague/iso3166) to be installed: `composer require league/iso3166`\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Country;\n\npublic function rules()\n{\n    return [\n        'country_code' =\u003e ['required', new Country()],\n    ];\n}\n```\n\nIf you want to validate a nullable country code field, you can call the `nullable()` method on the `CountryCode` rule. This way `null` and `0` are also passing values:\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Country;\n\npublic function rules()\n{\n    return [\n        'country_code' =\u003e [(new Country())-\u003enullable()],\n    ];\n}\n```\n\n### `Currency`\n\nDetermine if the field under validation is a valid [3 letter ISO4217 currency code](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) (example of valid currencies: `EUR`, `USD`, `CAD`).\n\n**Note** that this rule require the package [`league/iso3166`](https://github.com/thephpleague/iso3166) to be installed: `composer require league/iso3166`\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Currency;\n\npublic function rules()\n{\n    return [\n        'currency' =\u003e ['required', new Currency()], // Must be present and a valid currency\n    ];\n}\n```\n\nIf you want to validate a nullable currency field, simple do not let it be required as described in the [Laravel Docs for implicit validation rules](https://laravel.com/docs/master/validation#implicit-rules):\n\u003e ... when an attribute being validated is not present or contains an empty string, normal validation rules, including custom rules, are not run\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Currency;\n\npublic function rules()\n{\n    return [\n        'currency' =\u003e [new Currency()], // This will pass for any valid currency, an empty value or null\n    ];\n}\n```\n### `ModelsExist`\n\nDetermine if all the values in the input array exist as attributes for the given model class.\n\nBy default, the rule assumes that you want to validate using `id` attribute. In the example below the validation will pass if all `model_ids` exist for the `Model`.\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\ModelIdsExist;\n\npublic function rules()\n{\n    return [\n        'model_ids' =\u003e ['array', new ModelIdsExist(Model::class)],\n    ];\n}\n```\n\n\nYou can also pass an attribute name as the second argument. In the example below the validation will pass if there are users for each email given in the `user_emails` of the request.\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\ModelIdsExist;\n\npublic function rules()\n{\n    return [\n        'user_emails' =\u003e ['array', new ModelIdsExist(User::class, 'emails')],\n    ];\n}\n```\n\n### `Delimited`\n\nThis rule can validate a string containing delimited values. The constructor accepts a rule that is used to validate all separate values.\n\nHere's an example where we are going to validate a string containing comma separated email addresses.\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Delimited;\n\npublic function rules()\n{\n    return [\n        'emails' =\u003e [new Delimited('email')],\n    ];\n}\n```\n\nHere's some example input that passes this rule:\n\n- `'sebastian@example.com, alex@example.com'`\n- `''`\n- `'sebastian@example.com'`\n- `'sebastian@example.com, alex@example.com, brent@example.com'`\n- `' sebastian@example.com   , alex@example.com  ,   brent@example.com  '`\n\nThis input will not pass:\n- `'@example.com'`\n- `'nocomma@example.com nocommatoo@example.com'`\n- `'valid@example.com, invalid@'`\n\n#### Setting a minimum\nYou can set minimum amout of items that should be present:\n\n```php\n(new Delimited('email'))-\u003emin(2)\n```\n\n- `'sebastian@example.com, alex@example.com'` // passes\n- `'sebastian@example.com'` // fails\n\n#### Setting a maximum\n\n```php\n(new Delimited('email'))-\u003emax(2)\n```\n\n- `'sebastian@example.com'` // passes\n- `'sebastian@example.com, alex@example.com, brent@example.com'` // fails\n\n#### Allowing duplicate items\n\nBy default the rule will fail if there are duplicate items found.\n\n- `'sebastian@example.com, sebastian@example.com'` // fails\n\nYou can allowing duplicate items like this:\n\n```php\n(new Delimited('numeric'))-\u003eallowDuplicates()\n```\n\nNow this will pass: `1,1,2,2,3,3`\n\n#### Customizing the separator\n\n```php\n(new Delimited('email'))-\u003eseparatedBy(';')\n```\n\n- `'sebastian@example.com; alex@example.com; brent@example.com'` // passes\n- `'sebastian@example.com, alex@example.com, brent@example.com'` // fails\n\n#### Skip trimming of items\n\n```php\n(new Delimited('email'))-\u003edoNotTrimItems()\n```\n\n- `'sebastian@example.com,freek@example.com'` // passes\n- `'sebastian@example.com, freek@example.com'` // fails\n- `'sebastian@example.com , freek@example.com'` // fails\n\n#### Composite rules\n\nThe constructor of the validator accepts a validation rule string, a validate instance, or an array.\n\n```php\nnew Delimited('email|max:20')\n```\n- `'short@example.com'` // passes\n- `'invalid'` // fails\n- `'loooooooonnnggg@example.com'` // fails\n\n#### Passing custom error messages\n\nThe constructor of the validator accepts a custom error messages array as second parameter.\n\n```php\n// in a `FormRequest`\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Delimited;\n\npublic function rules()\n{\n    return [\n        'emails' =\u003e [new Delimited('email', $this-\u003emessages())],\n    ];\n}\n\npublic function messages()\n{\n    return [\n        'emails.email' =\u003e 'Not all the given e-mails are valid.',\n    ];\n}\n```\n\n# Laravel Model Exists Rule\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/mvanduijker/laravel-model-exists-rule.svg?style=flat-square)](https://packagist.org/packages/mvanduijker/laravel-model-exists-rule)\n![Build Status](https://github.com/mvanduijker/laravel-model-exists-rule/workflows/Run%20tests/badge.svg)\n[![Total Downloads](https://img.shields.io/packagist/dt/mvanduijker/laravel-model-exists-rule.svg?style=flat-square)](https://packagist.org/packages/mvanduijker/laravel-model-exists-rule)\n\n\nLaravel validation rule to check if a model exists.\n\nYou want to use this rule if the standard laravel `Rule::exists('table', 'column')` is not powerful enough.\nWhen you want to add joins to your exist rule, or the advanced Eloquent\\Builder features like whereHas this might be for you.\n\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require mvanduijker/laravel-model-exists-rule\n```\n\n## Usage\n\nSimple\n\n```php\n\u003c?php\n\nuse Duijker\\LaravelModelExistsRule\\ModelExists;\nuse Illuminate\\Foundation\\Http\\FormRequest;\n\nclass ExampleUserRequest extends FormRequest\n{\n    public function rules()\n    {\n        return [\n            'user_id' =\u003e [\n                'required',\n                new ModelExists(\\App\\Models\\User::class, 'id'),        \n            ],\n        ];\n    }\n}\n```\n\nAdvanced\n\n```php\n\u003c?php\n\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse Illuminate\\Validation\\Rule;\n\nclass ExampleUserRequest extends FormRequest\n{\n    public function rules()\n    {\n        return [\n            'user_id' =\u003e [\n                'required',\n                Rule::modelExists(\\App\\Models\\User::class, 'id', function (Builder $query) {\n                    $query-\u003ewhereHas('role', function (Builder $query) {\n                        $query-\u003ewhereIn('name', ['super-admin', 'admin']);\n                    });                    \n                }),        \n            ],\n        ];\n    }\n}\n```\n\n\n\n### ExtendedRFC3339\nPHP doesn't validate correctly RFC3339: https://github.com/laravel/framework/issues/35387\n* for example `2020-12-21T23:59:59+00:00` or `2020-12-21T23:59:59Z` return `false` but it is `true`.\n\nthis *Rule* uniform the date in format: `YYYY-MM-DDThh:mm:ss.mmm+nn:nn`\n\n## Usage\n```php\n\u003c?php\nnamespace App\\Api\\Controllers;\nuse App\\Http\\Controllers\\Controller;\n\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\ExtendedRFC3339;\n\nclass MyController extends Controller\n{\n    public function index()\n    {\n        $myData = ['starttime' =\u003e '2022-04-06T12:00:00.123+00:00']\n        Validator::make($myData, [\n            'starttime'           =\u003e [new ExtendedRFC3339()],\n        ])-\u003evalidate();\n    }\n}\n```\n\n\n\n\n# Laravel Profanity Validator\n\n```php\n\u003c?php\n// ...\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Profanity;\n\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e ['required', new Profanity()]\n        ]);\n\n        // ...\n    }\n}\n```\n\nThe validator will load the default locale in your `config/app.php` file configuration which by is `en`. **If your locale is not supported, please [post an issue for this project](https://github.com/arandilopez/laravel-profane/issues)**\n\nIf you want to use others dictionaries you can pass them as parameters in the validator.\n\n```php\n\u003c?php\n// ...\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Profanity;\n\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e ['required', new Profanity('en', 'es')]\n        ]);\n\n        // ...\n    }\n}\n```\n\nYou can also send as parameter a path of a file which is a dictionary in order to replace the default dictionary or **add a new non supported locale**.\n\n```php\n\u003c?php\n// ...\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Profanity;\n\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e ['required', new Profanity('en', 'es', resource_path('lang/fr/dict.php'))]\n        ]);\n\n        // ...\n    }\n}\n```\n\n#### Strict validation\n\nNow you can strictly validate the exact profane word in the content.\n\n```php\n\u003c?php\n// ...\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Profanity;\n\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e ['required', (new Profanity())-\u003evalidateStrictly(true)]\n        ]);\n\n        // ...\n    }\n}\n```\n\n\n\n\n# Laravel Password History Validation\n\n## Usage\nThis package will observe the created and updated event of the models (check the config file for settings) and records the password hashes automatically.\n\nIn Your Form Request or Inline Validation, All You Need To Do Is Instantiate The `Password` class passing the current user as an argument\n```php\n\u003c?php\nuse Simtabi\\Enekia\\Laravel\\Traits\\Rules\\Password;\n\n$this-\u003evalidate($request, [\n            'password' =\u003e [\n                'required', (new Password())-\u003echeckIfUsedBefore($request-\u003euser())\n            ]\n        ]);\n```\n\n### Cleaning Up Old Record - (Optional)\n\nBecause We Are Storing The Hashed Password In Your Database, Your Database Can Get Long When You Have Lots Of Users\n\nAdd PasswordHistoryTrait To Your User Model\n```php\n\u003c?php\nuse Simtabi\\Enekia\\Laravel\\Traits\\HasPasswordHistory;\nuse Illuminate\\Auth\\Authenticatable;\n\nclass User extends Authenticatable\n{\n    use Notifiable, HasPasswordHistory;\n\n}\n```\nThen You Can Run The Following Artisan Command\n\n``` bash\nphp artisan enekia:password-history:clear\n```\n\n\n\n\n## License\n\nIntervention Validation is licensed under the [MIT License](http://opensource.org/licenses/MIT).\n\n\n\n\n## Credits\n## Credits\n\n- [Riccardo Dalla Via](https://github.com/riccardodallavia)\n- [All Contributors](../../contributors)\nhttps://github.com/crazybooot/base64-validation\nhttps://github.com/Rackbeat/laravel-validate-https\nhttps://github.com/illuminatech/validation-composite\nhttps://github.com/arifszn/laravel-advanced-validation\nhttps://github.com/DivineOmega/laravel-password-exposed-validation-rule\nhttps://github.com/brokeyourbike/money-validation-laravel\nhttps://github.com/spatie/laravel-validation-rules\nhttps://github.com/mvanduijker/laravel-model-exists-rule\nhttps://github.com/arandilopez/laravel-profane\nhttps://github.com/maize-tech/laravel-remote-rule\nhttps://github.com/sandervankasteel/laravel-extended-validation\n- https://github.com/r4kib/validate-credit-card\n- https://github.com/aman00323/email-checker\n- https://github.com/tagmood/Laravel-Disposable-Phone\n- https://github.com/Propaganistas/Laravel-Disposable-Email\n- https://github.com/attla/disposable\n- https://github.com/aman00323/email-checker\n- https://github.com/romanzipp/Laravel-Validator-Pizza\n- https://github.com/KennedyTedesco/Validation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Fenekia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimtabi%2Fenekia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Fenekia/lists"}