sliverwing/alidayu
Composer 安装命令:
composer require sliverwing/alidayu
包简介
Sliverwing Alidayu API
README 文档
README
Usage
composer require sliverwing/alidayu- add
Sliverwing\Alidayu\AlidayuServiceProvider::class,to yourconfig/app.phpfile php artisan vendor:publish --provider="Sliverwing\Alidayu\AlidayuServiceProvider"- edit
config/alidayu.phpput your appkey & secretKey - put your sms config in
smsarray - edit your
.envfile and make sure you have properQUEUE_DRIVERconfiguration - add
ALIDAYU_APPKEYandALIDAYU_SECRETin your.envfile php artisan queue:work- edit your controller where you need to send sms
use Sliverwing\Alidayu\Jobs\AlidayuMessageJob;
//... in some action
$this->dispatch(new AlidayuMessageJob($phoneNumber, $paramInYourTemplate, $configNameInAlidayuConfig));
- then you will see result in console
example
- I have my
config/alidayu.phplike this:
<?php
return [
'appkey' => env('ALIDAYU_APPKEY'),
'secretKey' => env('ALIDAYU_SECRET'),
'sms' => [
'numsend' => [
'SmsFreeSignName' => '医*',
'SmsTemplateCode' => 'SMS_3*******',
],
],
];
- My template is
您的注册码为 ${code} - I can send my verification code via
$this->dispatch(new AlidayuMessageJob($phoneNumber, ['code'=>$code], "numsend"));
Thanks to https://github.com/flc1125/alidayu
统计信息
- 总下载量: 137
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-15