credit card validation yii 2
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist bryglen/yii2-validators "1.0.0"
or add
"bryglen/yii2-validator": "1.0.0"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your models :
public function rules()
{
return [
['cc', 'bryglen\validators\CreditCardValidator']
];
}