PHP code example of costa92 / yunpian-sms

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

    

costa92 / yunpian-sms example snippets


  Costa92\YunpianSMS\YunpianSMSServiceProvider::class,
  

  'YunpianSMS' => Costa92\YunpianSMS\Facades\YunpianSMS::class,
  

  SMS_API_KEY=xxx      // 云片的秘钥
  SMS_SEND_URL=xxx    //发短信的api
  SMS_SEND_TEXT=xxx  //发送的内容,验证码用@代替  ge:【xxx】您的验证码是@。如非本人操作,请忽略本短信
  

  /*
  * 参数 phone  可以是个string字符串或array字符串群发
  * 参数 code 可用为空,也可用不为空,
  * 
  */
  
  \YunpianSMS::sendSMS($phone,$code);
  
shell
  php artisan vendor:publish