katanyoo / yii2-otp-manager
This extension for send OTP via SMS to all number in Thailand
Installs: 64
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
This package is not auto-updated.
Last update: 2025-04-13 05:34:13 UTC
README
This extension for send OTP via SMS to all number in Thailand
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist katanyoo/yii2-otp-manager "*"
or add
"katanyoo/yii2-otp-manager": "*"
to the require section of your composer.json
file.
You need to run
php yii migrate/up --migrationPath=@vendor/katanyoo/yii2-otp-manager/migrations
Usage
To use this extension, simply add the following code in your application configuration:
return [ //.... 'components' => [ 'otpManager' => [ 'class' => 'katanyoo\otpmanager\OTPManager', 'provider_endpoint' => '<ENDPOINT>', 'username' => '<USERNAME>', 'password'=> '<PASSWORD>', ] ], ];
You can then send an sms as follows:
$result = Yii::$app->otpManager ->setMobileNo('08xxxxxxxx') ->send();