- backend/modules papkasiga smsgo papkasini joylashtirasiz.
- backend/config/main.php fayliga quyidagi kodni joylashtirasiz:
return [ ... 'modules' => [ 'smsgo' => [ 'class' => backend\modules\smsgo\Smsgo::class, ], ], ... ];
- backend/config/main.php (Backend da ishlatish uchun) yoki common/config/main.php (Umumiy proectda ishlatish uchun) quyidagi qatorni qo'shasiz:
return [ ... 'components' => [ ... 'sms' => [ 'class' => backend\modules\smsgo\models\Sms::class ], ... ], ... ];
- Migratsiya uchun console/config/main.php fayliga quyidagi qatorni qo'shasiz:
return [ ... 'controllerMap' => [ 'smsgo' => [ 'class' => "backend\modules\smsgo\controllers\MigrateController", ] ], ... ];
Migratsiyani amalga oshirish uchun:
php yii smsgo
Migratsiyani bekor qilish uchun:
php yii smsgo/down all
Yii::$app->sms->send(string $phone, string $message, int $user_id = null, string $from = self::MAIN_NUMBER)
yoki
(new \backend\modules\smsgo\models\Sms())->send(string $phone, string $message, int $user_id = null, string $from = self::MAIN_NUMBER)
Created by: Olimjon Gofurov! 😉