yanthink / sms
亿美软通、建周、3G新传媒短信接口
1.0
2017-07-12 08:28 UTC
Requires
- php: >=5.5.9
This package is not auto-updated.
Last update: 2024-11-10 05:08:59 UTC
README
亿美软通、建周、3G新传媒短信接口
安装
- 打开终端执行下面命令:
composer require yanthink/sms
- 打开
config/app.php
然后将下面内容添加到providers
数组中:
Yanthink\Sms\SmsServiceProvider::class,
- 将下面内容添加到
config/app.php
文件的aliases
数组中:
'Sms' => Yanthink\Sms\Facades\Sms::class,
- 在终端执行下面命令:
php artisan vendor:publish --provider="Yanthink\Sms\SmsServiceProvider"
使用
<?php namespace App\Http\Controllers; use Yanthink\Sms\Contracts\Sms; use Carbon\Carbon; class SmsController extends Controller { public function index(Sms $sms) { $sms->send('13000000000', '短信内容'); // 发送普通短信 $sms->send('13000000000', '短信内容', Carbon::now()->addMinutes(10)); // 发送定时短信 $sms->sendVoice('13000000000', '123456'); // 发送语音 $sms->getBalance(); // 获取短信余额 } }