PHP code example of tongv / aliyun-dysms
1. Go to this page and download the library: Download tongv/aliyun-dysms library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tongv / aliyun-dysms example snippets
`
php artisan vendor:publish --provider="LaraMall\AlidySms\AlidySmsServiceProvider"
修改 config/sms.php 中的阿里大于短信相关参数
//id
'ACCESS_KEY_ID'=>'',
//秘钥
'ACCESS_KEY_SECRET'=>'',
//config 每个操作对应的签名和模版编号
'CONFIG'=>[
'register'=>['签名','SMS_115928888'],
],
`
use Sms;
//短信发送成功 下面函数返回 true 反之 false
Sms::sned('13800000000','register',['code'=>'123456']);