PHP code example of len / sms-extend
1. Go to this page and download the library: Download len/sms-extend 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/ */
len / sms-extend example snippets
use Len\SmsExtend\SmsExtend;
$mobile_phone = "13788889999";
$message = "短信验证码是:000000";
$gatewayName = "网关名称";//以sms.php里面配置的网关为准,不传则取默认网关
$result = SmsExtend::send($mobile_phone, $message, $gatewayName);
$ php artisan vendor:publish
该命令会弹出选项,选择(Provider: Len\SmsExtend\Providers\SmsExtendServiceProvider)选项,即创建成功