PHP code example of buerxiaojie / laravel-aliyunmns

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

    

buerxiaojie / laravel-aliyunmns example snippets


composer 

  Buerxiaojie\AliyunMns\Providers\MnsServiceProvider::class,

  'MNS' => Buerxiaojie\AliyunMns\Facades\MNS::class,

  php artisan vendor:publish

  /**
   * 加入以下
   * 
   */
   
  ALIYUN_ACCESS_ID=
  ALIYUN_ACCESS_KEY=
  ALIYUN_MNS_ENDPOINT=
 

  /**
   * 导入
   *
   */
   
  use MNS;
  
  /**
   * 使用
   *
   */
   
  MNS::send("手机号码", "短信签名", "短信模板", ["模板参数的键" => "模板参数的值"], "流水号", "上行短信扩展码");