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: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.2 2017-05-08 21:33 UTC

This package is not auto-updated.

Last update: 2024-09-15 02:27:18 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();