Package Data | |
---|---|
Maintainer Username: | Arthuryin |
Maintainer Contact: | arthur.yinzhen@outlook.com (yinzhen) |
Package Create Date: | 2017-03-10 |
Package Last Update: | 2017-03-14 |
Language: | PHP |
License: | proprietary |
Last Refreshed: | 2024-11-19 03:09:42 |
Package Statistics | |
---|---|
Total Downloads: | 15 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
基于laravel开发, 开源的. 该项目包含创蓝短信验证, 语音验证接入.
composer require arthuryin/changlan-sms
或者在项目文件 composer.json 添加 "arthuryin/changlan-sms": "^1.0"composer update
.env
配置创蓝账号
CL_ACCOUNT=N422 #短信账户
CL_PASSWORD=N2Gkic21 #短信账户密码
CLV_ACCOUNT=YC750 #语音账户
CLV_PASSWORD=Sx********21e6 #语音账户密码
CLV_KEY=cc23a************012c337 #密钥在想用的地方直接使用即可, 可以设置签名为适合更多场景
<?php
namespace App\Http\Controllers;
use Arthuryin\ChuanglanSms;
use Illuminate\Http\Request;
use App\Http\Requests;
class SmsController extends Controller
{
public function getSendMS()
{
$changlan = new ChuanglanSms\ChuangLanSMS('签名'); // 签名是自己申请
$result = $changlan->sendSms(18602******, 3713); // 接收手机号, 验证码
}
public function getSendVoice()
{
$changlan = new ChuanglanSms\ChuangLanSMS();
$result = $changlan->sendVoice(18602******, 1132); // 接收手机号, 验证码
}
}