PHP code example of scolib / laravel-easy-sms

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

    

scolib / laravel-easy-sms example snippets


php artisan vendor:publish --provider "Sco\LaravelEasySms\LaravelServiceProvider"
 php
EasySms::send(13188888888, [
    'content'  => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ],
]);

// .....
$order = ...;
$message = new OrderPaidMessage($order);

EasySms::send(13188888888, $message);