sadi01/yii2-iran-national-code-validator Validates that the attribute value is a valid Iran national code.

Yii2 Iran National Code Validator

  1. Installation
  2. Usage

NationalCodeValidator validates that the attribute value is a valid Iran national code.

Installation

The preferred way to install this extension is through composer.

Either run console command

composer require sadi01/yii2-iran-national-code-validator "*"

Or add the package to the require section of your composer.json file:

{
    "require": {
      "sadi01/yii2-iran-national-code-validator": "*"
    }
}

then run composer update.

Usage

Once the validator is installed, simply use it in your model's rules :

public function rules()
    {
        return [
            ['national_code', NationalCodeValidator::class],
        ];
    }

0 0
1 follower
11 downloads
Yii Version: 2.0
License: BSD-3-Clause
Category: Validation
Developed by: Sadegh Shafii
Created on: Mar 24, 2022
Last updated: (not set)
Packagist Profile
Github Repository