mikk150/yii2-phone-validator

yii2 phonenumber validator

Maintainers

Package info

github.com/mikk150/yii2-phone-validator

Type:yii2-extension

pkg:composer/mikk150/yii2-phone-validator

Statistics

Installs: 12 386

Dependents: 1

Suggesters: 0

Stars: 5

Open Issues: 0

1.1.0 2025-11-13 13:10 UTC

This package is auto-updated.

Last update: 2026-03-13 13:57:03 UTC


README

This extension validates phone numbers

Build Status codecov

It will also format phone number to ITU-T E.164 or any other format that LibPhoneNumber supports(for full support see libphonenumber\PhoneNumberFormat)

Usage

// add this in your model
use mikk150\phonevalidator\PhoneNumberValidator;

// use the validator in your model rules
public function rules() {
    return [
        [['phone'], PhoneNumberValidator::className(), 'country' => 'US']
    ];
}