├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── stale.yml ├── CHANGE.md ├── LICENSE.md ├── README.md ├── composer.json └── src ├── Bootstrap.php ├── CardValidator.php ├── CardValidatorAsset.php ├── EmailValidator.php ├── EmailValidatorAsset.php ├── JsonValidator.php ├── JsonValidatorAsset.php ├── PhoneValidator.php ├── ValidatorTrait.php ├── assets └── js │ ├── card-validator.js │ ├── card-validator.min.js │ ├── email-validator.js │ ├── email-validator.min.js │ ├── json-validator.js │ └── json-validator.min.js └── messages ├── af └── kvvalidator.php ├── ar └── kvvalidator.php ├── az └── kvvalidator.php ├── bg └── kvvalidator.php ├── bs └── kvvalidator.php ├── ca └── kvvalidator.php ├── config.php ├── cs └── kvvalidator.php ├── da └── kvvalidator.php ├── de └── kvvalidator.php ├── el └── kvvalidator.php ├── en └── kvvalidator.php ├── eo └── kvvalidator.php ├── es └── kvvalidator.php ├── et └── kvvalidator.php ├── eu └── kvvalidator.php ├── fa └── kvvalidator.php ├── fi └── kvvalidator.php ├── fo └── kvvalidator.php ├── fr └── kvvalidator.php ├── gl └── kvvalidator.php ├── gu └── kvvalidator.php ├── he └── kvvalidator.php ├── hi └── kvvalidator.php ├── hr └── kvvalidator.php ├── hu └── kvvalidator.php ├── hy └── kvvalidator.php ├── id └── kvvalidator.php ├── is └── kvvalidator.php ├── it └── kvvalidator.php ├── ja └── kvvalidator.php ├── ka └── kvvalidator.php ├── kk └── kvvalidator.php ├── kn └── kvvalidator.php ├── ko └── kvvalidator.php ├── ky └── kvvalidator.php ├── lt └── kvvalidator.php ├── lv └── kvvalidator.php ├── mi └── kvvalidator.php ├── mk └── kvvalidator.php ├── mn └── kvvalidator.php ├── mr └── kvvalidator.php ├── ms └── kvvalidator.php ├── mt └── kvvalidator.php ├── nb └── kvvalidator.php ├── nl └── kvvalidator.php ├── nn └── kvvalidator.php ├── pl └── kvvalidator.php ├── pt-BR └── kvvalidator.php ├── pt └── kvvalidator.php ├── qu └── kvvalidator.php ├── ro └── kvvalidator.php ├── ru └── kvvalidator.php ├── sa └── kvvalidator.php ├── se └── kvvalidator.php ├── sk └── kvvalidator.php ├── sl └── kvvalidator.php ├── sq └── kvvalidator.php ├── sr-Latn └── kvvalidator.php ├── sr └── kvvalidator.php ├── sv └── kvvalidator.php ├── sw └── kvvalidator.php ├── ta └── kvvalidator.php ├── te └── kvvalidator.php ├── tg └── kvvalidator.php ├── th └── kvvalidator.php ├── tj └── kvvalidator.php ├── tl └── kvvalidator.php ├── tn └── kvvalidator.php ├── tr └── kvvalidator.php ├── ts └── kvvalidator.php ├── tt └── kvvalidator.php ├── uk └── kvvalidator.php ├── ur └── kvvalidator.php ├── uz └── kvvalidator.php ├── vi └── kvvalidator.php ├── zh-CN └── kvvalidator.php ├── zh-TW └── kvvalidator.php └── zu └── kvvalidator.php /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at kartikv2@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to yii2-validators 2 | ================================= 3 | Looking to contribute something to yii2-validators? **Here's how you can help.** 4 | 5 | Please take a moment to review this document in order to make the contribution 6 | process easy and effective for everyone involved. 7 | 8 | Following these guidelines helps to communicate that you respect the time of 9 | the developers managing and developing this open source project. In return, 10 | they should reciprocate that respect in addressing your issue or assessing 11 | patches and features. 12 | 13 | Using the issue tracker 14 | ----------------------- 15 | When [reporting bugs][reporting-bugs] or 16 | [requesting features][requesting-features], the 17 | [issue tracker on GitHub][issue-tracker] is the recommended channel to use. 18 | 19 | The issue tracker **is not** a place for support requests. Refer the 20 | [extension documentation and demos](http://demos.krajee.com/validators) and/or refer to the 21 | [webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help. 22 | 23 | Reporting bugs with yii2-validators 24 | ------------------------------------- 25 | We really appreciate clear bug reports that _consistently_ show an issue 26 | _within yii2-validators_. 27 | 28 | The ideal bug report follows these guidelines: 29 | 30 | 1. **Use the [GitHub issue search][issue-search]** — Check if the issue 31 | has already been reported. 32 | 2. **Check if the issue has been fixed** — Try to reproduce the problem 33 | using the code in the `master` branch. 34 | 3. **Isolate the problem** — Try to share a demo or a test case that 35 | consistently reproduces the problem. 36 | 37 | Please try to be as detailed as possible in your bug report, especially if an 38 | isolated test case cannot be made. Some useful questions to include the answer 39 | to are: 40 | 41 | - What steps can be used to reproduce the issue? 42 | - What is the bug and what is the expected outcome? 43 | - What browser(s) and Operating System have you tested with? 44 | - Does the bug happen consistently across all tested browsers? 45 | - What version of jQuery are you using? And what version of yii2-validators? 46 | - Are you using yii2-validators with other plugins? 47 | 48 | All of these questions will help others fix and identify any potential bugs. 49 | 50 | Requesting features in yii2-validators 51 | ---------------------------------------- 52 | Before starting work on a major feature for yii2-validators, **read the 53 | [documentation](http://demos.krajee.com/validators) first** or you may risk spending a considerable amount of 54 | time on something which the project developers are not interested in bringing into the project. 55 | 56 | ### Submitting a pull request 57 | 58 | We use GitHub's pull request system for submitting patches. Here are some 59 | guidelines to follow when creating the pull request for your fix. 60 | 61 | 1. Make sure to create a ticket for your pull request. This will serve as the 62 | bug ticket, and any discussion about the bug will take place there. Your pull 63 | request will be focused on the specific changes that fix the bug. 64 | 2. Make sure to reference the ticket you are fixing within your pull request. 65 | This will allow us to close off the ticket once we merge the pull request, or 66 | follow up on the ticket if there are any related blocking issues. 67 | 3. Explain why the specific change was made. Not everyone who is reviewing your 68 | pull request will be familiar with the problem it is fixing. 69 | 4. Run your tests first. If your tests aren't passing, the pull request won't 70 | be able to be merged. If you're breaking existing tests, make sure that you 71 | aren't causing any breaking changes. 72 | 5. Only include source changes. While it's not required, only including changes 73 | from the `src` directory will prevent merge conflicts from occuring. Making 74 | this happen can be as a simple as not committing changes from the `dist` 75 | directory. 76 | 77 | By following these steps, you will make it easier for your pull request to be 78 | reviewed and eventually merged. 79 | 80 | Triaging issues and pull requests 81 | --------------------------------- 82 | Anyone can help the project maintainers triage issues and review pull requests. 83 | 84 | ### Handling new issues 85 | 86 | yii2-validators regularly receives new issues which need to be tested and organized. 87 | 88 | When a new issue that comes in that is similar to another existing issue, it 89 | should be checked to make sure it is not a duplicate. Duplicates issues should 90 | be marked by replying to the issue with "Duplicate of #[issue number]" where 91 | `[issue number]` is the url or issue number for the existing issue. This will 92 | allow the project maintainers to quickly close off additional issues and keep 93 | the discussion focused within a single issue. 94 | 95 | If you can test issues that are reported to yii2-validators that contain test cases and 96 | confirm under what conditions bugs happen, that will allow others to identify 97 | what causes a bug quicker. 98 | 99 | ### Reviewing pull requests 100 | 101 | It is very common for pull requests to be opened for issues that contain a clear 102 | solution to the problem. These pull requests should be rigorously reviewed by 103 | the community before being accepted. If you are not sure about a piece of 104 | submitted code, or know of a better way to do something, do not hesitate to make 105 | a comment on the pull request. 106 | 107 | ### Reviving old tickets 108 | 109 | If you come across tickets which have not been updated for a while, you are 110 | encouraged to revive them. While this can be as simple as saying `:+1:`, it is 111 | best if you can include more information on the issue. Common bugs and feature 112 | requests are more likely to be fixed, whether it is by the community or the 113 | developers, so keeping tickets up to date is encouraged. 114 | 115 | Licensing 116 | --------- 117 | 118 | It should also be made clear that **all code contributed to yii2-validators** must be 119 | licensable under the [BSD-3 license][licensing]. Code that cannot be released 120 | under this license **cannot be accepted** into the project. 121 | 122 | [issue-search]: https://github.com/kartik-v/yii2-validators/search?q=&type=Issues 123 | [issue-tracker]: https://github.com/kartik-v/yii2-validators/issues 124 | [licensing]: https://github.com/kartik-v/yii2-validators/blob/master/LICENSE.md 125 | [reporting-bugs]: #reporting-bugs-with-yii2-validators 126 | [requesting-features]: #requesting-features-in-yii2-validators -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 3 | - [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate. 4 | - [ ] The issue still exists against the latest `master` branch of yii2-validators. 5 | - [ ] This is not an usage question. I confirm having gone through and read the [documentation](http://demos.krajee.com/validators) and [demos](http://demos.krajee.com/validators-demo/tree-view). 6 | - [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)). 7 | - [ ] I have attempted to find the simplest possible steps to reproduce the issue. 8 | - [ ] I have included a failing test as a pull request (Optional). 9 | 10 | ## Steps to reproduce the issue 11 | 12 | 1. 13 | 2. 14 | 3. 15 | 16 | ## Expected behavior and actual behavior 17 | 18 | When I follow those steps, I see... 19 | 20 | I was expecting... 21 | 22 | ## Environment 23 | 24 | #### Browsers 25 | 26 | - [ ] Google Chrome 27 | - [ ] Mozilla Firefox 28 | - [ ] Internet Explorer 29 | - [ ] Safari 30 | 31 | #### Operating System 32 | 33 | - [ ] Windows 34 | - [ ] Mac OS X 35 | - [ ] Linux 36 | - [ ] Mobile 37 | 38 | #### Libraries 39 | 40 | - jQuery version: 41 | - yii2-validators version: 42 | 43 | ## Isolating the problem 44 | 45 | - [ ] This bug happens [on the demos page](http://demos.krajee.com/validators-demo/tree-view) 46 | - [ ] The bug happens consistently across all tested browsers 47 | - [ ] This bug happens when using yii2-validators without other plugins. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Scope 2 | This pull request includes a 3 | 4 | - [ ] Bug fix 5 | - [ ] New feature 6 | - [ ] Translation 7 | 8 | ## Changes 9 | The following changes were made (this change is also documented in the [change log](https://github.com/kartik-v/yii2-validators/blob/master/CHANGE.md)): 10 | 11 | - 12 | - 13 | - 14 | 15 | ## Related Issues 16 | If this is related to an existing ticket, include a link to it as well. -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - bug 8 | - enhancement 9 | - pinned 10 | - security 11 | # Label to use when marking an issue as stale 12 | staleLabel: wontfix 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed if no further activity occurs. Thank you 17 | for your contributions. 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false -------------------------------------------------------------------------------- /CHANGE.md: -------------------------------------------------------------------------------- 1 | Change Log: `yii2-validators` 2 | ============================= 3 | 4 | ## Version 1.0.3 5 | 6 | **Date:** 22-Aug-2019 7 | 8 | - Correct `JsonValidator`. 9 | 10 | ## Version 1.0.2 11 | 12 | **Date:** 22-Aug-2019 13 | 14 | - (enh #7): Implement `JsonValidator`. 15 | - (enh #5, #6): Update `libphonenumber` version to latest release . 16 | - (enh #4): Update Portugese Brazilian Translations . 17 | - (bug #3): Correct EmailValidator validate value. 18 | - Update README. 19 | 20 | ## Version 1.0.1 21 | 22 | **Date:** 09-Oct-2018 23 | 24 | - Update composer dependencies 25 | - (kartik-v/yii2-krajee-base#94): Refactor code and consolidate / optimize properties within traits. 26 | 27 | ## Version 1.0.0 28 | 29 | **Date:** 01-Aug-2018 30 | 31 | - Add `CardValidator` 32 | - (enh #1, #2): Added `kartik\validators\Bootstrap` (vuongxuongminh) 33 | - Add `PhoneValidator` 34 | - Add `EmailValidator` 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 - 2018, Kartik Visweswaran 2 | Krajee.com 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | * Neither the names of Kartik Visweswaran or Krajee nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | yii2-validators 2 | =============== 3 | 4 | [![Stable Version](https://poser.pugx.org/kartik-v/yii2-validators/v/stable)](https://packagist.org/packages/kartik-v/yii2-validators) 5 | [![Unstable Version](https://poser.pugx.org/kartik-v/yii2-validators/v/unstable)](https://packagist.org/packages/kartik-v/yii2-validators) 6 | [![License](https://poser.pugx.org/kartik-v/yii2-validators/license)](https://packagist.org/packages/kartik-v/yii2-validators) 7 | [![Total Downloads](https://poser.pugx.org/kartik-v/yii2-validators/downloads)](https://packagist.org/packages/kartik-v/yii2-validators) 8 | [![Monthly Downloads](https://poser.pugx.org/kartik-v/yii2-validators/d/monthly)](https://packagist.org/packages/kartik-v/yii2-validators) 9 | [![Daily Downloads](https://poser.pugx.org/kartik-v/yii2-validators/d/daily)](https://packagist.org/packages/kartik-v/yii2-validators) 10 | 11 | This extension adds new model validator components for Yii2 frameworkor and/or enhances existing Yii2 model validators. 12 | 13 | The `EmailValidator` extends the [yii\validators\EmailValidator](https://www.yiiframework.com/doc/api/2.0/yii-validators-emailvalidator) 14 | component to support multiple email inputs for Yii2 framework. In addition this validator allows setting the `multiple` property and 15 | setting the `min` and `max` number of email addresses allowed. This is useful for adding validation rules to your attributes 16 | in the model and also adds enhanced client validation support for ActiveForm inputs at runtime via Javascript. 17 | 18 | The `PhoneValidator` extends the [yii\validators\Validator](https://www.yiiframework.com/doc/api/2.0/yii-validators-validator) component 19 | using [libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) based on Google's 20 | [libphonenumber](https://github.com/googlei18n/libphonenumber) library. 21 | 22 | The `CardValidator` extends the [yii\validators\Validator](https://www.yiiframework.com/doc/api/2.0/yii-validators-validator) component. 23 | It validates standard debit and credit card number inputs using Luhn's checksum validation. It also helps auto detect the card types and 24 | additionally validating the card holder name, expiry date and CVV entered. 25 | 26 | The `JsonValidator` extends the [yii\validators\Validator](https://www.yiiframework.com/doc/api/2.0/yii-validators-validator) component. 27 | It validates JSON input in text area fields. The validator also helps to overwrite the JSON input as a pretty format via `prettify` setting. 28 | It includes both server and client validations. 29 | 30 | ## Demo 31 | You can see detailed [documentation and demos](http://demos.krajee.com/validators) on usage of this extension. 32 | 33 | ## Installation 34 | 35 | The preferred way to install this extension is through [composer](http://getcomposer.org/download/). 36 | 37 | > NOTE: Check the [composer.json](https://github.com/kartik-v/yii2-validators/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json. 38 | 39 | Either run 40 | 41 | ``` 42 | $ php composer.phar require kartik-v/yii2-validators "@dev" 43 | ``` 44 | 45 | or add 46 | 47 | ``` 48 | "kartik-v/yii2-validators": "@dev" 49 | ``` 50 | 51 | to the ```require``` section of your `composer.json` file. 52 | 53 | ## Usage 54 | 55 | ### EmailValidator 56 | 57 | This class extends the `yii\validators\EmailValidator` class to offer multiple email validation support. The `EmailValidator` class 58 | can be easily used via the alias `k-email` in your model validation rules. For example in your model you can use this as shown below: 59 | 60 | ```php 61 | use yii\db\ActiveRecord; 62 | 63 | class EmailModel extends ActiveRecord { 64 | /** 65 | * @return array the validation rules. 66 | */ 67 | public function rules() 68 | { 69 | return [ 70 | [['to', 'cc', 'bcc'], 'k-email', 'allowName' => true, 'enableIDN' => true, 'max' => 5], 71 | ]; 72 | } 73 | } 74 | ``` 75 | 76 | In your view where you render the model inputs with ActiveForm - you may set `enableClientValidation` to control whether you need client side validation. 77 | 78 | ```php 79 | // views/email/send.php 80 | 81 | use yii\widgets\ActiveForm; 82 | 83 | $form = ActiveForm::begin(['enableClientValidation' => true]); 84 | echo $form->field($model, 'to')->textInput(); 85 | echo $form->field($model, 'cc')->textInput(); 86 | echo $form->field($model, 'bcc')->textInput(); 87 | // other fields 88 | ActiveForm::end(); 89 | ``` 90 | 91 | ### PhoneValidator 92 | 93 | This class extends the `yii\validators\Validator` class to validate phone numbers using 94 | [libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) based on Google's 95 | [libphonenumber](https://github.com/googlei18n/libphonenumber) library. The `PhoneValidator` class 96 | can be easily used via the alias `k-phone` in your model validation rules. For example in your 97 | model you can use this as shown below: 98 | 99 | ```php 100 | use yii\db\ActiveRecord; 101 | 102 | class ContactModel extends ActiveRecord { 103 | /** 104 | * @return array the validation rules. 105 | */ 106 | public function rules() 107 | { 108 | return [ 109 | [['phone1'], 'k-phone', 'countryValue' => 'US'], 110 | [['phone2'], 'k-phone', 'countryAttribute' => 'country', 'applyFormat' => false], 111 | ]; 112 | } 113 | } 114 | ``` 115 | 116 | ### CardValidator 117 | 118 | The `CardValidator` extends the [yii\validators\Validator](https://www.yiiframework.com/doc/api/2.0/yii-validators-validator) component. 119 | It validates standard debit and credit card number inputs using Luhn's checksum validation. It also helps auto detect the card types and 120 | additionally validating the card holder name, expiry date and CVV entered. The `CardValidator` class 121 | can be easily used via the alias `k-card` in your model validation rules. For example in your 122 | model you can use this as shown below: 123 | 124 | ```php 125 | use yii\db\ActiveRecord; 126 | 127 | class PaymentModel extends ActiveRecord { 128 | /** 129 | * @return array the validation rules. 130 | */ 131 | public function rules() 132 | { 133 | return [ 134 | [ 135 | ['card_number'], 136 | 'k-card', 137 | 'typeAttribute' => 'card_type', 138 | 'holderAttribute' => 'holderName', 139 | 'expiryYearAttribute' => 'expiryYear', 140 | 'expiryMonthAttribute' => 'expiryMonth', 141 | 'cvvAttribute' => 'cvv', 142 | ], 143 | ]; 144 | } 145 | } 146 | ``` 147 | 148 | ### JsonValidator 149 | 150 | The `JsonValidator` extends the [yii\validators\Validator](https://www.yiiframework.com/doc/api/2.0/yii-validators-validator) component. 151 | It validates JSON input in text area fields. The validator also helps to overwrite the JSON input as a pretty format via `prettify` setting. 152 | It includes both server and client validations. The `JsonValidator` class can be easily used via the alias `k-json` in your model validation 153 | rules. For example in your model you can use this as shown below: 154 | 155 | ```php 156 | use yii\db\ActiveRecord; 157 | 158 | class ProductModel extends ActiveRecord { 159 | /** 160 | * @return array the validation rules. 161 | */ 162 | public function rules() 163 | { 164 | return [ 165 | [ 166 | ['products_list_json'], 167 | 'k-json', 168 | 'prettify' => true, // set this to false if you do not wish to prettify the json input 169 | ], 170 | ]; 171 | } 172 | } 173 | ``` 174 | 175 | ## License 176 | 177 | **yii2-validators** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kartik-v/yii2-validators", 3 | "description": "Enhanced Yii2 model validator components / utilities for Yii2 Framework", 4 | "keywords": [ 5 | "email", 6 | "multiple", 7 | "validator", 8 | "krajee", 9 | "yii2", 10 | "model", 11 | "validation", 12 | "jquery" 13 | ], 14 | "homepage": "https://github.com/kartik-v/yii2-email-validator", 15 | "type": "yii2-extension", 16 | "license": "BSD-3-Clause", 17 | "authors": [ 18 | { 19 | "name": "Kartik Visweswaran", 20 | "email": "kartikv2@gmail.com", 21 | "homepage": "http://www.krajee.com/" 22 | } 23 | ], 24 | "require": { 25 | "kartik-v/yii2-krajee-base": ">=2.0.0", 26 | "giggsey/libphonenumber-for-php": "^8" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "kartik\\validators\\": "src" 31 | } 32 | }, 33 | "extra": { 34 | "bootstrap": "kartik\\validators\\Bootstrap", 35 | "branch-alias": { 36 | "dev-master": "1.0.x-dev" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Bootstrap.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | 9 | namespace kartik\validators; 10 | 11 | use yii\base\BootstrapInterface; 12 | use yii\validators\Validator; 13 | 14 | /** 15 | * Bootstrap for additional validators to `yii\validators\Validator::$builtInValidators` 16 | * for easier use and friendly syntax. 17 | */ 18 | class Bootstrap implements BootstrapInterface 19 | { 20 | /** 21 | * @inheritdoc 22 | */ 23 | public function bootstrap($app) 24 | { 25 | Validator::$builtInValidators = array_merge(Validator::$builtInValidators, [ 26 | 'k-email' => 'kartik\validators\EmailValidator', 27 | 'k-phone' => 'kartik\validators\PhoneValidator', 28 | 'k-card' => 'kartik\validators\CardValidator', 29 | 'k-json' => 'kartik\validators\JsonValidator', 30 | ]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CardValidator.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | 9 | namespace kartik\validators; 10 | 11 | use Yii; 12 | use yii\base\InvalidValueException; 13 | use yii\validators\Validator; 14 | use yii\base\Model; 15 | use kartik\base\TranslationTrait; 16 | use yii\helpers\Json; 17 | 18 | /** 19 | * CardValidator validates standard debit and credit card number inputs using Luhn's checksum validation. It also 20 | * additionally validates the card holder name, expiry date and CVV entered. 21 | */ 22 | class CardValidator extends Validator 23 | { 24 | use ValidatorTrait; 25 | use TranslationTrait; 26 | 27 | /** 28 | * Valid Card list 29 | * @var string 30 | */ 31 | const ELECTRON = 'Visa Electron'; 32 | const MAESTRO = 'Maestro'; 33 | const FBF = 'Forbrugsforeningen'; 34 | const DANKORT = 'Dankort'; 35 | const VISA = 'Visa'; 36 | const MASTERCARD = 'Mastercard'; 37 | const AMEX = 'American Express'; 38 | const CARTE_BLANCHE = 'Carte Blanche'; 39 | const DINERS = 'Diners Club'; 40 | const BC_GLOBAL = 'BC Global'; 41 | const DISCOVER = 'Discover'; 42 | const INSTA_PAY = 'Insta Payment'; 43 | const JCB = 'JCB'; 44 | const VOYAGER = 'Voyager'; 45 | const KOREAN_LOCAL = 'Korean Local'; 46 | const SOLO = 'Solo'; 47 | const SWITCH_CARD = 'Switch Card'; 48 | const LASER = 'Laser'; 49 | const UNIONPAY = 'Union Pay'; 50 | const MIR = 'mir'; 51 | 52 | /** 53 | * @var array holds the configurations for each of the credit / debit cards including the card lengths and regex 54 | * patterns to check for valid card number prefixes 55 | */ 56 | public $cards = [ 57 | // Debit cards must come first, since they have more specific patterns than their credit-card equivalents. 58 | self::ELECTRON => [ 59 | 'pattern' => '/^(?:417500|4026\\d{2}|4917\\d{2}|4913\\d{2}|4508\\d{2}|4844\\d{2})\\d{10}$/', 60 | 'cvvLength' => [3], 61 | 'luhn' => true, 62 | ], 63 | self::MAESTRO => [ 64 | 'pattern' => ' /^(5[06-9]|6[37])\d*$/', 65 | 'cvvLength' => [3], 66 | 'luhn' => true, 67 | ], 68 | self::FBF => [ 69 | 'pattern' => '/^600[0-9]{13}$/', 70 | 'cvvLength' => [3], 71 | 'luhn' => true, 72 | ], 73 | self::DANKORT => [ 74 | 'pattern' => '/^5019[0-9]{12}$/', 75 | 'cvvLength' => [3], 76 | 'luhn' => true, 77 | ], 78 | // Credit cards 79 | self::VISA => [ 80 | 'pattern' => '/^4[0-9]{12}([0-9]{3})?$/', 81 | 'cvvLength' => [3], 82 | 'luhn' => true, 83 | ], 84 | self::MASTERCARD => [ 85 | 'pattern' => '/^(5[0-5]|2[2-7])[0-9]{14}$/', 86 | 'cvvLength' => [3], 87 | 'luhn' => true, 88 | ], 89 | self::AMEX => [ 90 | 'pattern' => '/^3[47][0-9]{13}$/', 91 | 'cvvLength' => [3, 4], 92 | 'luhn' => true, 93 | ], 94 | self::CARTE_BLANCHE => [ 95 | 'pattern' => '/^389[0-9]{11}$/', 96 | 'cvvLength' => [3], 97 | 'luhn' => true, 98 | ], 99 | self::DINERS => [ 100 | 'pattern' => '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/', 101 | 'cvvLength' => [3], 102 | 'luhn' => true, 103 | ], 104 | self::BC_GLOBAL => [ 105 | 'pattern' => '/^(6541|6556)[0-9]{12}$/', 106 | 'cvvLength' => [3], 107 | 'luhn' => true, 108 | ], 109 | self::DISCOVER => [ 110 | 'pattern' => '/^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$/', 111 | 'cvvLength' => [3], 112 | 'luhn' => true, 113 | ], 114 | self::INSTA_PAY => [ 115 | 'pattern' => '/^63[7-9][0-9]{13}$/', 116 | 'cvvLength' => [3], 117 | 'luhn' => true, 118 | ], 119 | self::JCB => [ 120 | 'pattern' => '/^(3[0-9]{4}|2131|1800)[0-9]{11}$/', 121 | 'cvvLength' => [3], 122 | 'luhn' => true, 123 | ], 124 | self::VOYAGER => [ 125 | 'pattern' => '/^8699[0-9]{11}$/', 126 | 'cvvLength' => [3], 127 | 'luhn' => true, 128 | ], 129 | self::KOREAN_LOCAL => [ 130 | 'pattern' => '/^9[0-9]{15}$/', 131 | 'cvvLength' => [3], 132 | 'luhn' => true, 133 | ], 134 | self::SOLO => [ 135 | 'pattern' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/', 136 | 'cvvLength' => [3], 137 | 'luhn' => true, 138 | ], 139 | self::SWITCH_CARD => [ 140 | 'pattern' => '/^(4903|4905|4911|4936|6333|6759)[0-9]{12}|(4903|4905|4911|4936|6333|6759)[0-9]{14}|(4903|4905|4911|4936|6333|6759)[0-9]{15}|564182[0-9]{10}|564182[0-9]{12}|564182[0-9]{13}|633110[0-9]{10}|633110[0-9]{12}|633110[0-9]{13}$/', 141 | 'cvvLength' => [3], 142 | 'luhn' => true, 143 | ], 144 | self::LASER => [ 145 | 'pattern' => '/^(6304|6706|6709|6771)[0-9]{12,15}$/', 146 | 'cvvLength' => [3], 147 | 'luhn' => true, 148 | ], 149 | self::UNIONPAY => [ 150 | 'pattern' => '/^(62|88)[0-9]{14,17}$/', 151 | 'cvvLength' => [3], 152 | 'luhn' => false, 153 | ], 154 | self::MIR => [ 155 | 'pattern' => '/^220[0-4][0-9]{12}$/', 156 | 'cvvLength' => [3], 157 | 'luhn' => true, 158 | ] 159 | ]; 160 | 161 | /** 162 | * @var array list of allowed cards. If not set or empty, all cards set in [[cards]] will be allowed. For example, 163 | * to allow only VISA and MASTERCARD, set this to `[CardValidator::VISA, CardValidator::MASTERCARD]`. 164 | */ 165 | public $allowedCards = []; 166 | 167 | /** 168 | * @var bool whether to auto update the card number as pure numeric digits and overwrite the model attribute 169 | */ 170 | public $autoUpdateNumber = true; 171 | 172 | /** 173 | * @var bool whether to auto detect card type based on pattern detection in [[cards]] configuration and 174 | * auto update the [[typeValue]]. 175 | */ 176 | public $autoDetectType = true; 177 | 178 | /** 179 | * @var bool whether to auto update and store the auto detected type within the [[typeAttribute]]. Applicable only 180 | * when [[autoDetectType]] is set to `true`. 181 | */ 182 | public $autoUpdateType = true; 183 | 184 | /** 185 | * @var bool whether to validate the card holder name 186 | */ 187 | public $validateHolder = true; 188 | 189 | /** 190 | * @var bool whether to validate the card expiry date (year / month) 191 | */ 192 | public $validateExpiry = true; 193 | 194 | /** 195 | * @var bool whether to validate the card CVV 196 | */ 197 | public $validateCVV = true; 198 | 199 | /** 200 | * @var string the card type attribute 201 | */ 202 | public $typeAttribute; 203 | 204 | /** 205 | * @var string the card holder attribute 206 | */ 207 | public $holderAttribute; 208 | 209 | /** 210 | * @var int the card expiry year attribute 211 | */ 212 | public $expiryYearAttribute; 213 | 214 | /** 215 | * @var int the card expiry month attribute 216 | */ 217 | public $expiryMonthAttribute; 218 | 219 | /** 220 | * @var int the card CVV attribute 221 | */ 222 | public $cvvAttribute; 223 | 224 | /** 225 | * @var string card type to check (overrides value set in [[typeAttribute]]) 226 | */ 227 | public $typeValue; 228 | 229 | /** 230 | * @var string card holder name to check (overrides value set in [[holderAttribute]]) 231 | */ 232 | public $holderValue; 233 | 234 | /** 235 | * @var int card expiry year to check (overrides value set in [[expiryYearAttribute]]) 236 | */ 237 | public $expiryYearValue; 238 | 239 | /** 240 | * @var int card expiry month to check (overrides value set in [[expiryMonthAttribute]]) 241 | */ 242 | public $expiryMonthValue; 243 | 244 | /** 245 | * @var int card cvv to check (overrides value set in [[cvvAttribute]]) 246 | */ 247 | public $cvvValue; 248 | 249 | /** 250 | * @var string the regular expression pattern to match for card holder name 251 | */ 252 | public $holderPattern = '/^[a-z ,.\'-]+$/i'; 253 | 254 | /** 255 | * @var string the message shown if the detected card type is invalid 256 | */ 257 | public $invalidTypeMessage; 258 | 259 | /** 260 | * @var string the message shown if the detected card holder is invalid 261 | */ 262 | public $invalidHolderMessage; 263 | 264 | /** 265 | * @var string the message shown if the detected card expiry year or month is invalid 266 | */ 267 | public $invalidExpiryMessage; 268 | 269 | /** 270 | * @var string the message shown if the detected card CVV is invalid 271 | */ 272 | public $invalidCVVMessage; 273 | 274 | /** 275 | * @var array the final list of cards based on allowedCards 276 | */ 277 | protected $_cards = []; 278 | 279 | /** 280 | * @inheritdoc 281 | * @throws \ReflectionException 282 | */ 283 | public function init() 284 | { 285 | $this->_msgCat = 'kvvalidator'; 286 | parent::init(); 287 | $this->initSettings(); 288 | } 289 | 290 | /** 291 | * Initialize settings 292 | * @throws \ReflectionException 293 | */ 294 | protected function initSettings() 295 | { 296 | $this->initI18N(); 297 | $this->setMsg('message', Yii::t('kvvalidator', '"{number}" is not a valid card number')); 298 | $this->setMsg('invalidTypeMessage', Yii::t('kvvalidator', 'Unsupported card number "{number}"')); 299 | $this->setMsg('invalidHolderMessage', Yii::t('kvvalidator', 'Invalid holder name "{holder}"')); 300 | $this->setMsg('invalidExpiryMessage', Yii::t('kvvalidator', 'Invalid expiry month/year "{expiry}"')); 301 | $this->setMsg('invalidCVVMessage', Yii::t('kvvalidator', 'Invalid CVV "{cvv}"')); 302 | if (!empty($this->allowedCards) && is_array($this->cards)) { 303 | foreach ($this->allowedCards as $card) { 304 | if (isset($this->cards[$card])) { 305 | $this->_cards[$card] = $this->cards[$card]; 306 | } 307 | } 308 | } else { 309 | $this->_cards = $this->cards; 310 | } 311 | } 312 | 313 | /** 314 | * @inheritdoc 315 | */ 316 | public function validateAttribute($model, $attribute) 317 | { 318 | if (!isset($model->$attribute)) { 319 | return; 320 | } 321 | $this->initValues($model, $attribute); 322 | $result = $this->validateValue($model->$attribute); 323 | if (!empty($result)) { 324 | if (isset($result[2])) { 325 | $attributes = (array)$result[2]; 326 | foreach ($attributes as $attrib) { 327 | $attr = $attrib . 'Attribute'; 328 | $this->addError($model, $this->$attr, $result[0], $result[1]); 329 | } 330 | } else { 331 | $this->addError($model, $attribute, $result[0], $result[1]); 332 | } 333 | } 334 | } 335 | 336 | /** 337 | * @inheritdoc 338 | */ 339 | public function clientValidateAttribute($model, $attribute, $view) 340 | { 341 | /** 342 | * @var Model $model 343 | */ 344 | CardValidatorAsset::register($view); 345 | 346 | $options = array_replace_recursive($this->getClientOptions($model, $attribute), [ 347 | 'cards' => $this->_cards, 348 | 'invalidMessage' => $this->message, 349 | 'invalidTypeMessage' => $this->invalidTypeMessage, 350 | ]); 351 | return 'CardValidator.validate(value, messages, ' . Json::encode($options) . ');'; 352 | } 353 | 354 | /** 355 | * Gets expiry date 356 | * @return string 357 | */ 358 | protected function getExpiryDate() 359 | { 360 | return $this->expiryMonthValue . '/' . $this->expiryYearValue; 361 | } 362 | 363 | /** 364 | * Validates a value. 365 | * A validator class can implement this method to support data validation out of the context of a data model. 366 | * @param mixed $value the data value to be validated. 367 | * @return array|null the error message and the array of parameters to be inserted into the error message. 368 | */ 369 | protected function validateValue($value) 370 | { 371 | $number = preg_replace('/[^0-9]/', '', $value); // strip non numeric characters 372 | if (empty($this->typeValue) || empty($this->_cards) || empty($this->_cards[$this->typeValue])) { 373 | return [$this->invalidTypeMessage, ['number' => $number]]; 374 | } 375 | if (!$this->validCard($number)) { 376 | return [$this->message, ['number' => $number]]; 377 | } 378 | if ($this->validateHolder && !$this->isValidHolder()) { 379 | return [$this->invalidHolderMessage, ['holder' => $this->holderValue, 'holder']]; 380 | } 381 | if ($this->validateExpiry && !$this->isValidExpiry()) { 382 | return [$this->invalidExpiryMessage, ['expiry' => $this->getExpiryDate()], ['expiryMonth', 'expiryYear']]; 383 | } 384 | if ($this->validateCVV && !$this->isValidCVV()) { 385 | return [$this->invalidCVVMessage, ['cvv' => $this->cvvValue], 'cvv']; 386 | } 387 | return null; 388 | } 389 | 390 | /** 391 | * Gets value based on attribute property or the value property 392 | * @param Model $model the model instance 393 | * @param string $prop the attribute property 394 | * @param string $default the default value 395 | * @return mixed|null|string 396 | */ 397 | protected function parseValue($model, $prop, $default = null) 398 | { 399 | $value = "{$prop}Value"; 400 | if (isset($this->$value)) { 401 | return $this->$value; 402 | } 403 | $attribute = "{$prop}Attribute"; 404 | if (isset($this->$attribute) && isset($model->{$this->$attribute})) { 405 | return $model->{$this->$attribute}; 406 | } 407 | return $default; 408 | } 409 | 410 | /** 411 | * Gets card type 412 | * @param string $number 413 | * @return string 414 | */ 415 | protected function getCardType($number) 416 | { 417 | foreach ($this->_cards as $type => $card) { 418 | if (isset($card['pattern']) && preg_match($card['pattern'], $number)) { 419 | return $type; 420 | } 421 | } 422 | return null; 423 | } 424 | 425 | /** 426 | * Gets the property of a card 427 | * @param string $prop the card property 428 | * @return mixed 429 | * @throws InvalidValueException 430 | */ 431 | protected function getCardProp($prop) 432 | { 433 | if (isset($this->typeValue) && isset($this->_cards[$this->typeValue]) && isset($this->_cards[$this->typeValue][$prop])) { 434 | return $this->_cards[$this->typeValue][$prop]; 435 | } 436 | throw new InvalidValueException('No card type detected. One of "typeValue" or "typeAttribute" must be set with a valid value.'); 437 | } 438 | 439 | /** 440 | * Initializes related attribute values 441 | * @param Model $model the model instance 442 | * @param string $attribute the attribute 443 | */ 444 | protected function initValues($model, $attribute) 445 | { 446 | $this->expiryMonthValue = $this->parseValue($model, 'expiryMonth', ''); 447 | $this->expiryYearValue = $this->parseValue($model, 'expiryYear', ''); 448 | $this->holderValue = $this->parseValue($model, 'holder'); 449 | $this->cvvValue = $this->parseValue($model, 'cvv'); 450 | $number = preg_replace('/[^0-9]/', '', $model->$attribute); // strip non numeric characters 451 | if ($this->autoDetectType && !isset($this->typeValue)) { 452 | $this->typeValue = $this->getCardType($number); 453 | if ($this->autoUpdateType && isset($this->typeAttribute)) { 454 | $model->{$this->typeAttribute} = $this->typeValue; 455 | } 456 | } 457 | if ($this->autoUpdateNumber) { 458 | $model->$attribute = $number; 459 | } 460 | } 461 | 462 | /** 463 | * Check if the card holder name is valid 464 | * 465 | * @return bool validation result 466 | */ 467 | public function isValidHolder() 468 | { 469 | return !empty($this->holderValue) && preg_match($this->holderPattern, $this->holderValue); 470 | } 471 | 472 | /** 473 | * Validates if the card expiry is correct 474 | * 475 | * @return bool the validation result 476 | */ 477 | public function isValidExpiry() 478 | { 479 | $month = $this->expiryMonthValue; 480 | $year = $this->expiryYearValue; 481 | $monthNow = intval(date('n')); 482 | $yearNow = intval(date('Y')); 483 | if (is_scalar($month)) { 484 | $month = intval($month); 485 | } 486 | if (is_scalar($year)) { 487 | $year = intval($year); 488 | } 489 | return is_integer($month) && $month >= 1 && $month <= 12 && is_integer($year) && 490 | ($year > $yearNow || ($year === $yearNow && $month > $monthNow)) && $year < ($yearNow + 10); 491 | } 492 | 493 | /** 494 | * Check if the card CVV is valid 495 | * @return bool 496 | */ 497 | public function isValidCVV() 498 | { 499 | return ctype_digit($this->cvvValue) && $this->validCVVLength(); 500 | } 501 | 502 | /** 503 | * Luhn checksum check 504 | * @param string|int $number the card number 505 | * @return bool 506 | */ 507 | public static function luhnCheck($number) 508 | { 509 | $cardNumber = strrev($number); 510 | $checkSum = 0; 511 | for ($i = 0; $i < strlen($cardNumber); $i++) { 512 | $currentNum = substr($cardNumber, $i, 1); 513 | if ($i % 2 == 1) { 514 | $currentNum *= 2; 515 | } 516 | if ($currentNum > 9) { 517 | $firstNum = $currentNum % 10; 518 | $secondNum = ($currentNum - $firstNum) / 10; 519 | $currentNum = $firstNum + $secondNum; 520 | } 521 | $checkSum += $currentNum; 522 | } 523 | return $checkSum % 10 == 0; 524 | } 525 | 526 | /** 527 | * Check if the card luhn checksum is valid 528 | * @param string|int $number the card number 529 | * @return bool 530 | */ 531 | protected function validLuhn($number) 532 | { 533 | $luhn = $this->getCardProp('luhn'); 534 | if (empty($luhn)) { 535 | return true; 536 | } 537 | return static::luhnCheck($number); 538 | } 539 | 540 | /** 541 | * Check if the card number is valid 542 | * @param string|int $number the card number 543 | * @return bool 544 | */ 545 | protected function validCard($number) 546 | { 547 | $pattern = $this->getCardProp('pattern'); 548 | return preg_match($pattern, $number) && $this->validLuhn($number); 549 | } 550 | 551 | /** 552 | * Check if the card CVV length is valid 553 | * @return bool 554 | */ 555 | protected function validCVVLength() 556 | { 557 | if (empty($this->cvvValue)) { 558 | return false; 559 | } 560 | $cvvLength = $this->getCardProp('cvvLength'); 561 | foreach ($cvvLength as $length) { 562 | if (strlen($this->cvvValue) === $length) { 563 | return true; 564 | } 565 | } 566 | return false; 567 | } 568 | } 569 | -------------------------------------------------------------------------------- /src/CardValidatorAsset.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | namespace kartik\validators; 9 | 10 | use kartik\base\AssetBundle; 11 | 12 | /** 13 | * Card Validation asset bundle. 14 | */ 15 | class CardValidatorAsset extends AssetBundle 16 | { 17 | /** 18 | * @inheritdoc 19 | */ 20 | public $depends = [ 21 | 'yii\validators\ValidationAsset' 22 | ]; 23 | 24 | public $publishOptions = [ 25 | 'forceCopy'=>true, 26 | ]; 27 | 28 | /** 29 | * @inheritdoc 30 | */ 31 | public function init() 32 | { 33 | $this->setSourcePath(__DIR__ . '/assets'); 34 | $this->setupAssets('js', ['js/card-validator']); 35 | parent::init(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/EmailValidator.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | namespace kartik\validators; 9 | 10 | use Yii; 11 | use yii\base\Model; 12 | use yii\helpers\Json; 13 | use yii\validators\EmailValidator as YiiEmailValidator; 14 | use yii\validators\PunycodeAsset; 15 | use kartik\base\TranslationTrait; 16 | 17 | /** 18 | * EmailValidator validates that the attribute value contains a list of valid emails separated by a delimiter. 19 | */ 20 | class EmailValidator extends YiiEmailValidator 21 | { 22 | use TranslationTrait; 23 | use ValidatorTrait; 24 | 25 | /** 26 | * @var boolean whether multiple email addresses are supported (separated by the [[delimiter]]) 27 | */ 28 | public $multiple = true; 29 | /** 30 | * @var string the delimiter to separate multiple emails (applicable only when [[multiple]] is `true`) 31 | */ 32 | public $delimiter = ','; 33 | /** 34 | * @var int minimum number of emails required (applicable only when [[multiple]] is `true`). Setting this to `0` or 35 | * `NULL` will mean no minimum limit. 36 | */ 37 | public $min = 0; 38 | /** 39 | * @var int maximum number of emails required (applicable only when [[multiple]] is `true`). Setting this to `0` or 40 | * `NULL` will mean no maximum limit. 41 | */ 42 | public $max = 0; 43 | /** 44 | * @var string the message when the number of emails are below the [[min]] threshold 45 | */ 46 | public $minThresholdMessage; 47 | /** 48 | * @var string the message when the number of emails are above the [[max]] threshold 49 | */ 50 | public $maxThresholdMessage; 51 | /** 52 | * @inheritdoc 53 | */ 54 | public $message; 55 | 56 | /** 57 | * @inheritdoc 58 | * @throws \ReflectionException 59 | * @throws \yii\base\InvalidConfigException 60 | */ 61 | public function init() 62 | { 63 | $isMsgSet = isset($this->message); 64 | $this->_msgCat = 'kvvalidator'; 65 | parent::init(); 66 | $this->initSettings($isMsgSet); 67 | } 68 | 69 | /** 70 | * Initializes settings 71 | * @param boolean $isMsgSet whether [[message]] property is set 72 | * @throws \ReflectionException 73 | */ 74 | protected function initSettings($isMsgSet = false) 75 | { 76 | if (!$this->multiple) { 77 | return; 78 | } 79 | $this->initI18N(); 80 | $this->setMsg( 81 | 'minThresholdMessage', 82 | Yii::t('kvvalidator', 'At least {value, number} {value, plural, one{email is} other{emails are}} required.') 83 | ); 84 | $this->setMsg( 85 | 'maxThresholdMessage', 86 | Yii::t('kvvalidator', 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.') 87 | ); 88 | if (!$isMsgSet) { 89 | $this->message = Yii::t('kvvalidator', '"{value}" is not a valid email address.'); 90 | } 91 | } 92 | 93 | /** 94 | * @inheritdoc 95 | * @throws \yii\base\NotSupportedException 96 | */ 97 | public function validateAttribute($model, $attribute) 98 | { 99 | if (!$this->multiple) { 100 | parent::validateAttribute($model, $attribute); 101 | return; 102 | } 103 | $emails = empty($model->$attribute) ? [] : explode($this->delimiter, $model->$attribute); 104 | if (empty($emails)) { 105 | return; 106 | } 107 | $count = count($emails); 108 | if (!empty($this->min) && $count < $this->min) { 109 | $this->addError($model, $attribute, $this->minThresholdMessage, ['{value}' => $this->min]); 110 | return; 111 | } 112 | if (!empty($this->max) && $count > $this->max) { 113 | $this->addError($model, $attribute, $this->maxThresholdMessage, ['{value}' => $this->max]); 114 | return; 115 | } 116 | foreach ($emails as $email) { 117 | $email = trim($email); 118 | if (!empty($email) && !empty($this->validateValue($email))) { 119 | $this->addError($model, $attribute, $this->message, ['{value}' => $email]); 120 | return; 121 | } 122 | } 123 | } 124 | 125 | /** 126 | * @inheritdoc 127 | */ 128 | public function clientValidateAttribute($model, $attribute, $view) 129 | { 130 | if (!$this->multiple) { 131 | return parent::clientValidateAttribute($model, $attribute, $view); 132 | } 133 | /** 134 | * @var Model $model 135 | */ 136 | EmailValidatorAsset::register($view); 137 | if ($this->enableIDN) { 138 | PunycodeAsset::register($view); 139 | } 140 | $options = array_replace_recursive($this->getClientOptions($model, $attribute), [ 141 | 'delimiter' => $this->delimiter, 142 | 'min' => $this->min, 143 | 'max' => $this->max, 144 | 'message' => $this->message, 145 | 'minThresholdMessage' => $this->minThresholdMessage, 146 | 'maxThresholdMessage' => $this->maxThresholdMessage, 147 | ]); 148 | return 'EmailValidator.validate(value, messages, ' . Json::htmlEncode($options) . ');'; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/EmailValidatorAsset.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | namespace kartik\validators; 9 | 10 | use kartik\base\AssetBundle; 11 | 12 | /** 13 | * Email Validation asset bundle. 14 | */ 15 | class EmailValidatorAsset extends AssetBundle 16 | { 17 | /** 18 | * @inheritdoc 19 | */ 20 | public $depends = [ 21 | 'yii\validators\ValidationAsset' 22 | ]; 23 | 24 | /** 25 | * @inheritdoc 26 | */ 27 | public function init() 28 | { 29 | $this->setSourcePath(__DIR__ . '/assets'); 30 | $this->setupAssets('js', ['js/email-validator']); 31 | parent::init(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/JsonValidator.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | 9 | namespace kartik\validators; 10 | 11 | use Yii; 12 | use yii\base\InvalidArgumentException; 13 | use yii\base\Model; 14 | use yii\helpers\Json; 15 | use yii\validators\Validator; 16 | use kartik\base\TranslationTrait; 17 | 18 | /** 19 | * JsonValidator will help parse a valid JSON input format and also gives an option to prettify the json input 20 | */ 21 | class JsonValidator extends Validator 22 | { 23 | use TranslationTrait; 24 | use ValidatorTrait; 25 | 26 | /** 27 | * @var bool whether to prettify the json output (only via server mode) 28 | */ 29 | public $prettify = true; 30 | 31 | /** 32 | * @inheritdoc 33 | */ 34 | public function init() 35 | { 36 | $this->_msgCat = 'kvvalidator'; 37 | parent::init(); 38 | $this->initI18N(); 39 | $this->setMsg('message', Yii::t('kvvalidator', 'Invalid JSON input for "{attribute}". {exception}')); 40 | } 41 | 42 | /** 43 | * {@inheritdoc} 44 | */ 45 | public function validateAttribute($model, $attribute) 46 | { 47 | $value = $model->$attribute; 48 | if ($value === '' || $value === null) { 49 | return; 50 | } 51 | $out = $this->validateJson($value); 52 | if (isset($out['data'])) { 53 | if ($this->prettify) { 54 | $model->$attribute = Json::encode($out['data'], JSON_PRETTY_PRINT); 55 | } 56 | } else { 57 | $this->addError($model, $attribute, $this->message, ['exception' => $out['message']]); 58 | } 59 | } 60 | 61 | /** 62 | * @inheritdoc 63 | */ 64 | protected function validateValue($value) 65 | { 66 | $out = $this->validateJson($value); 67 | if (!isset($out['data'])) { 68 | return [$this->message, ['exception' => $out['message']]]; 69 | } 70 | return null; 71 | } 72 | 73 | /** 74 | * @inheritdoc 75 | */ 76 | public function clientValidateAttribute($model, $attribute, $view) 77 | { 78 | JsonValidatorAsset::register($view); 79 | $options = $this->getClientOptions($model, $attribute); 80 | $opts = json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 81 | return "JsonValidator.validate(value, messages, {$opts});"; 82 | } 83 | 84 | /** 85 | * @inheritdoc 86 | */ 87 | public function getClientOptions($model, $attribute) 88 | { 89 | /** 90 | * @var Model $model 91 | */ 92 | $label = $model->getAttributeLabel($attribute); 93 | $options = [ 94 | 'message' => $this->formatMessage($this->message, [ 95 | 'attribute' => $label, 96 | ]), 97 | ]; 98 | return $options; 99 | } 100 | 101 | /** 102 | * Validate JSON Input 103 | * @param string $value 104 | * @return array output data and message 105 | */ 106 | protected function validateJson($value) 107 | { 108 | try { 109 | return ['data' => Json::decode($value), 'message' => 'success']; 110 | } catch (InvalidArgumentException $e) { 111 | return ['data' => null, 'message' => $e->getMessage()]; 112 | } catch (\Exception $e) { 113 | return ['data' => null, 'message' => $e->getMessage()]; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/JsonValidatorAsset.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | namespace kartik\validators; 9 | 10 | use kartik\base\AssetBundle; 11 | /** 12 | * Asset bundle for JsonValidator 13 | * 14 | * @author Kartik Visweswaran 15 | * @since 1.0 16 | */ 17 | class JsonValidatorAsset extends AssetBundle 18 | { 19 | /** 20 | * @inheritdoc 21 | */ 22 | public $depends = [ 23 | 'yii\validators\ValidationAsset' 24 | ]; 25 | 26 | /** 27 | * @inheritdoc 28 | */ 29 | public function init() 30 | { 31 | $this->setSourcePath(__DIR__ . '/assets'); 32 | $this->setupAssets('js', ['js/json-validator']); 33 | parent::init(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/PhoneValidator.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | 9 | namespace kartik\validators; 10 | 11 | use libphonenumber\NumberParseException; 12 | use libphonenumber\PhoneNumberFormat; 13 | use libphonenumber\PhoneNumberUtil; 14 | use Yii; 15 | use yii\validators\Validator; 16 | use kartik\base\TranslationTrait; 17 | 18 | /** 19 | * PhoneValidator validates phone numbers for given country and formats. The country codes and attributes value should 20 | * be ISO 3166-1 alpha-2 codes. 21 | */ 22 | class PhoneValidator extends Validator 23 | { 24 | use TranslationTrait; 25 | use ValidatorTrait; 26 | 27 | /** 28 | * @var string the model attribute name that stores the country code value. 29 | */ 30 | public $countryAttribute; 31 | 32 | /** 33 | * @var string the value for country code. This will override any value set in [[countryAttribute]]. This is the 34 | * [ISO 3166-1](http://www.iso.org/iso/country_names_and_code_elements) two letter country code. If the number is 35 | * passed in an international format (e.g. +44 117 496 0123), then the region code is not needed, and can be null. 36 | * Failing that, the library will use this value to work out the phone number based on rules loaded for that region. 37 | */ 38 | public $countryValue; 39 | 40 | /** 41 | * @var boolean whether country code is mandatory for parsing the phone number 42 | */ 43 | public $countryRequired = true; 44 | 45 | /** 46 | * @var boolean whether to apply the parsed phone format and update the attribute 47 | */ 48 | public $applyFormat = true; 49 | 50 | /** 51 | * @var string the format to use when applying the format 52 | * @see [[PhoneNumberFormat]] 53 | */ 54 | public $format = PhoneNumberFormat::INTERNATIONAL; 55 | 56 | /** 57 | * @var string the message to show if an invalid phone number is parsed. 58 | */ 59 | public $message; 60 | 61 | /** 62 | * @var string the message to show if country value is empty and [[countryRequired]] is `true`. 63 | */ 64 | public $countryRequiredMessage; 65 | 66 | /** 67 | * @var string the message to show when a [[NumberParseException]] is thrown during phone number parsing. 68 | */ 69 | public $parseExceptionMessage; 70 | 71 | /** 72 | * @inheritdoc 73 | * @throws \ReflectionException 74 | */ 75 | public function init() 76 | { 77 | $this->_msgCat = 'kvvalidator'; 78 | parent::init(); 79 | $this->initSettings(); 80 | } 81 | 82 | /** 83 | * Initializes the validator settings 84 | * @throws \ReflectionException 85 | */ 86 | protected function initSettings() 87 | { 88 | $this->initI18N(); 89 | $this->setMsg('message', Yii::t('kvvalidator', '"{value}" does not seem to be a valid phone number.')); 90 | $this->setMsg('countryRequiredMessage', Yii::t('kvvalidator', 'Country is required for phone validation.')); 91 | $this->setMsg('parseExceptionMessage', 92 | Yii::t('kvvalidator', 'Unexpected or unrecognized phone number format.')); 93 | } 94 | 95 | /** 96 | * @inheritdoc 97 | */ 98 | public function validateAttribute($model, $attribute) 99 | { 100 | $country = ''; 101 | if (isset($this->countryValue)) { 102 | $country = $this->countryValue; 103 | } elseif (isset($this->countryAttribute)) { 104 | $country = $model->{$this->countryAttribute}; 105 | } 106 | if (empty($country) && $this->countryRequired) { 107 | $this->addError($model, $attribute, $this->countryRequiredMessage, ['{value}' => $model->$attribute]); 108 | return; 109 | } 110 | $phoneUtil = PhoneNumberUtil::getInstance(); 111 | try { 112 | $numberProto = $phoneUtil->parse($model->$attribute, $country); 113 | if (!$phoneUtil->isValidNumber($numberProto)) { 114 | $this->addError($model, $attribute, $this->message, ['{value}' => $model->$attribute]); 115 | } elseif ($this->applyFormat) { 116 | $model->$attribute = $phoneUtil->format($numberProto, $this->format); 117 | } 118 | } catch (NumberParseException $e) { 119 | $this->addError($model, $attribute, $this->parseExceptionMessage, ['{value}' => $model->$attribute]); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/ValidatorTrait.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 6 | * @version 1.0.3 7 | */ 8 | 9 | namespace kartik\validators; 10 | 11 | use yii\base\Model; 12 | 13 | /** 14 | * Trait ValidatorTrait 15 | * 16 | * @package kartik\validators 17 | * 18 | * @author Kartik Visweswaran 19 | * @since 1.0 20 | */ 21 | trait ValidatorTrait 22 | { 23 | /** 24 | * Sets message property 25 | * @param string $type 26 | * @param string $msg 27 | */ 28 | protected function setMsg($type, $msg) 29 | { 30 | if (!isset($this->$type)) { 31 | $this->$type = $msg; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/assets/js/card-validator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 card client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | var CardValidator; 15 | (function ($) { 16 | "use strict"; 17 | CardValidator = { 18 | cards: {}, 19 | validate: function (value, messages, options) { 20 | 21 | const lib = yii.validation; 22 | this.cards = options.cards; 23 | value = value.split(' ').join(''); 24 | 25 | let cardType = this.getCardType(value); 26 | if (!cardType) { 27 | lib.addMessage(messages, this.prepareMessage(options.invalidTypeMessage, value)); 28 | return; 29 | } 30 | if (this.cards[cardType].luhn && !(this.validateLuhn(value))) { 31 | lib.addMessage(messages, this.prepareMessage(options.invalidMessage, value)); 32 | } 33 | }, 34 | validateLuhn: function (value) { 35 | value = value.split("").reverse().join(""); 36 | let checkSum = 0; 37 | for (let i = 0; i < value.length; i++) { 38 | let currentNum = parseInt(value.charAt(i)); 39 | if (i % 2 === 1) { 40 | currentNum *= 2; 41 | } 42 | if (currentNum > 9) { 43 | let firstNum = currentNum % 10; 44 | let secondNum = (currentNum - firstNum) / 10; 45 | currentNum = firstNum + secondNum; 46 | } 47 | checkSum += currentNum; 48 | } 49 | return (checkSum % 10) === 0; 50 | }, 51 | 52 | getCardType: function (value) { 53 | for (let cardType in this.cards) { 54 | let exp = eval(unescape(this.cards[cardType].pattern)); 55 | if (exp.test(value)) { 56 | return cardType; 57 | } 58 | } 59 | return false; 60 | }, 61 | prepareMessage: function (str, replace) { 62 | return str.replace('{number}', replace); 63 | } 64 | }; 65 | })(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/card-validator.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 card client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | var CardValidator;(function($){"use strict";CardValidator={cards:{},validate:function(value,messages,options){const lib=yii.validation;this.cards=options.cards;value=value.split(' ').join('');let cardType=this.getCardType(value);if(!cardType){lib.addMessage(messages,this.prepareMessage(options.invalidTypeMessage,value));return}if(this.cards[cardType].luhn&&!(this.validateLuhn(value))){lib.addMessage(messages,this.prepareMessage(options.invalidMessage,value))}},validateLuhn:function(value){value=value.split("").reverse().join("");let checkSum=0;for(let i=0;i9){let firstNum=currentNum%10;let secondNum=(currentNum-firstNum)/10;currentNum=firstNum+secondNum}checkSum+=currentNum}return(checkSum%10)===0},getCardType:function(value){for(let cardType in this.cards){let exp=eval(unescape(this.cards[cardType].pattern));if(exp.test(value)){return cardType}}return!1},prepareMessage:function(str,replace){return str.replace('{number}',replace)}}})(window.jQuery) -------------------------------------------------------------------------------- /src/assets/js/email-validator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 email client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | var EmailValidator; 15 | (function ($) { 16 | "use strict"; 17 | EmailValidator = { 18 | validate: function (value, messages, options) { 19 | var delimiter = options.delimiter || ',', emails = value.split(delimiter), 20 | count = emails.length, i, lib = yii.validation, email; // jshint ignore:line 21 | if (count === 0) { 22 | return; 23 | } 24 | if (options.max && count > options.max) { 25 | lib.addMessage(messages, options.maxThresholdMessage, options.max); 26 | } 27 | if (options.min && count < options.min) { 28 | lib.addMessage(messages, options.minThresholdMessage, options.min); 29 | } 30 | for (i = 0; i < count; i++) { 31 | email = $.trim(emails[i]); 32 | lib.email(email, messages, options); // jshint ignore:line 33 | } 34 | } 35 | }; 36 | })(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/email-validator.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 email client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */var EmailValidator;!function(a){"use strict";EmailValidator={validate:function(i,e,m){var s,d,l=m.delimiter||",",t=i.split(l),n=t.length,r=yii.validation;if(0!==n)for(m.max&&n>m.max&&r.addMessage(e,m.maxThresholdMessage,m.max),m.min&&ns;s++)d=a.trim(t[s]),r.email(d,e,m)}}}(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/json-validator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 json client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | var JsonValidator; 15 | (function ($) { 16 | 'use strict'; 17 | JsonValidator = { 18 | validate: function (value, messages, options) { 19 | var obj, exception = '', msg = options.message, lib = yii.validation; // jshint ignore:line 20 | if (value === '' || value === null) { 21 | return; 22 | } 23 | try { 24 | obj = JSON.parse(value); 25 | } catch (err) { 26 | exception = err.message; 27 | } 28 | if (!obj || exception) { 29 | lib.addMessage(messages, msg.replace('{exception}', exception), value); 30 | } 31 | } 32 | }; 33 | })(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/json-validator.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-validators 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019 5 | * @version 1.0.2 6 | * 7 | * Yii2 json client validation library for `kartik-v/yii2-validators` 8 | * 9 | * Author: Kartik Visweswaran 10 | * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com 11 | * For more JQuery plugins visit http://plugins.krajee.com 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */var JsonValidator;!function(){"use strict";JsonValidator={validate:function(a,e,i){var s,t="",n=i.message,o=yii.validation;if(""!==a&&null!==a){try{s=JSON.parse(a)}catch(r){t=r.message}s&&!t||o.addMessage(e,n.replace("{exception}",t),a)}}}}(window.jQuery); -------------------------------------------------------------------------------- /src/messages/af/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ar/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/az/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/bg/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/bs/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ca/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/config.php: -------------------------------------------------------------------------------- 1 | __DIR__ . DIRECTORY_SEPARATOR . '..', 5 | // string, required, root directory containing message translations. 6 | 'messagePath' => __DIR__, 7 | // array, required, list of language codes that the extracted messages 8 | // should be translated to. For example, ['zh-CN', 'de']. 9 | 'languages' => ['af', 'ar', 'az', 'bg', 'bs', 'ca', 'cs', 'da', 'de', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kk', 'kn', 'ko', 'ky', 'lt', 'lv', 'mi', 'mk', 'mn', 'mr', 'ms', 'mt', 'nb', 'nl', 'nn', 'pl', 'pt', 'pt-BR', 'qu', 'ro', 'ru', 'sa', 'se', 'sk', 'sl', 'sq', 'sr', 'sr-Latn', 'sv', 'sw', 'ta', 'te', 'th', 'tg', 'tj', 'tl', 'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 'uz', 'vi', 'zh-CN', 'zh-TW', 'zu'], 10 | // string, the name of the function for translating messages. 11 | // Defaults to 'Yii::t'. This is used as a mark to find the messages to be 12 | // translated. You may use a string for single function name or an array for 13 | // multiple function names. 14 | 'translator' => 'Yii::t', 15 | // boolean, whether to sort messages by keys when merging new messages 16 | // with the existing ones. Defaults to false, which means the new (untranslated) 17 | // messages will be separated from the old (translated) ones. 18 | 'sort' => false, 19 | // boolean, whether the message file should be overwritten with the merged messages 20 | 'overwrite' => true, 21 | // boolean, whether to remove messages that no longer appear in the source code. 22 | // Defaults to false, which means each of these messages will be enclosed with a pair of '' marks. 23 | 'removeUnused' => false, 24 | // array, list of patterns that specify which files/directories should NOT be processed. 25 | // If empty or not set, all files/directories will be processed. 26 | // A path matches a pattern if it contains the pattern string at its end. For example, 27 | // '/a/b' will match all files and directories ending with '/a/b'; 28 | // the '*.svn' will match all files and directories whose name ends with '.svn'. 29 | // and the '.svn' will match all files and directories named exactly '.svn'. 30 | // Note, the '/' characters in a pattern matches both '/' and '\'. 31 | // See helpers/FileHelper::findFiles() description for more details on pattern matching rules. 32 | 'only' => ['*.php'], 33 | // array, list of patterns that specify which files (not directories) should be processed. 34 | // If empty or not set, all files will be processed. 35 | // Please refer to "except" for details about the patterns. 36 | // If a file/directory matches both a pattern in "only" and "except", it will NOT be processed. 37 | 'except' => [ 38 | '.svn', 39 | '.git', 40 | '.gitignore', 41 | '.gitkeep', 42 | '.hgignore', 43 | '.hgkeep', 44 | '/messages', 45 | ], 46 | // Generated file format. Can be either "php", "po" or "db". 47 | 'format' => 'php', 48 | // When format is "db", you may specify the following two options 49 | //'db' => 'db', 50 | //'sourceMessageTable' => '{{%source_message}}', 51 | ]; -------------------------------------------------------------------------------- /src/messages/cs/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/da/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/de/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/el/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/en/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/eo/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/es/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/et/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/eu/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/fa/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/fi/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/fo/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/fr/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/gl/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/gu/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/he/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/hi/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/hr/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/hu/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/hy/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/id/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/is/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/it/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ja/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ka/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/kk/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/kn/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ko/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ky/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/lt/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/lv/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/mi/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/mk/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/mn/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/mr/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ms/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/mt/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/nb/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/nl/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/nn/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/pl/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/pt-BR/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '"{number}" não é um número de cartão válido.', 21 | '"{value}" does not seem to be a valid phone number.' => '"{value}" não parece ser um número de telefone válido.', 22 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => 'Um máximo de {value, number} {value, plural, um{email is} outros{emails are}} permitido.', 23 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => 'Pelo menos {value, number} {value, plural, um{email is} outros{emails are}} requeridos.', 24 | 'Country is required for phone validation.' => 'Páis é requerido para validação de telefone.', 25 | 'Invalid CVV "{cvv}"' => 'CVV Inválido', 26 | 'Invalid expiry month/year "{expiry}"' => 'Mês/Ano de expiração é inválido.', 27 | 'Invalid holder name "{holder}"' => 'Nome do portador do cartão inválido.', 28 | 'Unsupported card number "{number}"' => 'Número de cartão não suportado.', 29 | '"{value}" is not a valid email address.' => '', 30 | 'Invalid JSON input for "{attribute}". {exception}' => '', 31 | 'Unexpected or unrecognized phone number format.' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/pt/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/qu/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ro/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ru/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sa/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/se/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sk/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sl/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sq/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sr-Latn/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sr/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sv/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/sw/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ta/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/te/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tg/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/th/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tj/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tl/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tn/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tr/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ts/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/tt/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/uk/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/ur/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/uz/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/vi/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/zh-CN/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/zh-TW/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | -------------------------------------------------------------------------------- /src/messages/zu/kvvalidator.php: -------------------------------------------------------------------------------- 1 | '', 21 | '"{value}" does not seem to be a valid phone number.' => '', 22 | '"{value}" is not a valid email address.' => '', 23 | 'A maximum of {value, number} {value, plural, one{email is} other{emails are}} allowed.' => '', 24 | 'At least {value, number} {value, plural, one{email is} other{emails are}} required.' => '', 25 | 'Country is required for phone validation.' => '', 26 | 'Invalid CVV "{cvv}"' => '', 27 | 'Invalid JSON input for "{attribute}". {exception}' => '', 28 | 'Invalid expiry month/year "{expiry}"' => '', 29 | 'Invalid holder name "{holder}"' => '', 30 | 'Unexpected or unrecognized phone number format.' => '', 31 | 'Unsupported card number "{number}"' => '', 32 | ]; 33 | --------------------------------------------------------------------------------