2017 © Pedro Peláez
 

library aliyun-sms

阿里云短信服务php调用代码

image

mrgoon/aliyun-sms

阿里云短信服务php调用代码

  • Thursday, October 19, 2017
  • by mrgoon
  • Repository
  • 3 Watchers
  • 52 Stars
  • 3,212 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 5 Versions
  • 37 % Grown

The README.md

介绍

阿里大于关闭了新用户渠道,迁移到阿里云短信服务上,然而阿里云短信服务在5月底更新了api。 在github上找了一下,轮子都是基于2016年的接口,非常难受。 自己造了一个轮子,亲测可用。, (*1)

  • 安装 composer require mrgoon/aliyun-sms dev-master

基于laravel框架的使用方法

  • 加载 在config/app的providers中添加 Mrgoon\AliSms\ServiceProvider::class

同时,可以选择性添加aliases, (*2)

控制台运行: php artisan vendor:publish, (*3)

根据新增的aliyunsms.php 文件,在.env文件中添加环境变量:, (*4)

ALIYUN_SMS_AK=your access key
ALIYUN_SMS_AS=your secret key
ALIYUN_SMS_SIGN_NAME=sign name
  • 使用
$aliSms = new AliSms();
$response = $aliSms->sendSms('phone number', 'SMS_code', ['name'=> 'value in your template']);
//dump($response);

非laravel框架的使用方法

  • 加载方式通过composer,不变
  • 使用样例代码如下:
$config = [
        'access_key' => 'your access key',
        'access_secret' => 'your access secret',
        'sign_name' => 'your sign name',
    ];

    $aliSms = new Mrgoon\AliSms\AliSms();
    $response = $sms->sendSms('phone number', 'tempplate code', ['name'=> 'value in your template'], $config);

The Versions

19/10 2017

dev-feature/sms

dev-feature/sms

阿里云短信服务php调用代码

  Sources   Download

MIT

The Requires

 

by Avatar mrgoon

sdk aliyun aliyun-sms

19/10 2017

2.0.2

2.0.2.0

阿里云短信服务php调用代码

  Sources   Download

MIT

The Requires

 

by Avatar mrgoon

sdk aliyun aliyun-sms

19/10 2017

dev-master

9999999-dev

阿里云短信服务php调用代码

  Sources   Download

MIT

The Requires

 

by Avatar mrgoon

sdk aliyun aliyun-sms

19/10 2017

2.0.1

2.0.1.0

阿里云短信服务php调用代码

  Sources   Download

MIT

The Requires

 

by Avatar mrgoon

sdk aliyun aliyun-sms

28/06 2017

1.0.0

1.0.0.0

阿里云短信服务php调用代码

  Sources   Download

MIT

The Requires

 

by Avatar mrgoon

sdk aliyun aliyun-sms