PHP code example of zuogechengxu / luosimao
1. Go to this page and download the library: Download zuogechengxu/luosimao 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/ */
zuogechengxu / luosimao example snippets
# 安装依赖
composer sms.php 配置文件
php artisan vendor:publish --provider="Zuogechengxu\Luosimao\LuosimaoServiceProvider"
# 在 sms.php 中配置 luosimao 的短信 api key
'api_key' => env('LUOSIMAO_KEY', '123456'),
# 控制器内使用 短信单发,群发和查询余额
use Zuogechengxu\Luosimao\Facades\Sms;
$res = Sms::send('13800138000', '验证码:123456【铁壳测试】');
$res = Sms::send_batch(['13800138000', '13800138001'], '验证码:123456【铁壳测试】');
$res = Sms::getRemaining();