PHP code example of jmhc / laravel-sms

1. Go to this page and download the library: Download jmhc/laravel-sms 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/ */

    

jmhc / laravel-sms example snippets


use Jmhc\SmsHelper\SmsHelper;

$sms = SmsHelper::getSms();

$res = $sms->setPhone(13188888888)
    ->setCode(6379)
    ->setMessage([
        'content'  => '您的验证码为: 6379',
    ])
    ->send();

// input
var_dump($res);
// 下次发送需要等待时间(手机号 => 等待秒数)
// [
//     13188888888 => 60,
// ]

php artisan vendor:publish --tag=jmhc-sms