yanthink/sms
sms
亿美软通、建周、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(); // 获取短信余额
}
}
Related Packages
rinvex/laravel-authy
Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authe...
78,344
32
laravel-notification-channels/authy
Authy notification channel for Laravel, with the ability to send in-app, sms, an...
46,708
57
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 1.0 | >=5.5.9 | MIT |