Skip to content
/ aliyun Public

提供阿里云 OSS、MNS(含SMS短信消息)、memcached等服务接口,适用于Laravel、Symfony、TinyLara等所有支持composer的PHP框架。

License

Notifications You must be signed in to change notification settings

vicleos/aliyun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aliyun Service for Laravel

提供阿里云OSS、MNS、Memcahe服务接口

安装

通过 Composer 安装

composer require vicleos/aliyun

编辑 config/app.php 注册 providers 和 aliases

'providers' => [
    Vicleos\Aliyun\AliyunServiceProvider::class,
]
'aliases' => [
    'Aliyun' => Vicleos\Aliyun\Facades\Aliyun::class,
]

生成配置文件

php artisan vendor:publish --provider="Vicleos\Aliyun\AliyunServiceProvider"

将在config文件夹中生成一个aliyun.php的配置文件,在该配置文件中填入相关信息。

使用方法及代码示例

MNS

阿里云MNS除提供消息中间件服务外同时具备发送短信(SMS)的能力,使用方法:

  • 通过 createClient() 方法实例化一个mns对象
  • 调用该对象的SendSMSMessage()方法即可发送SMS消息到指定手机号
use Aliyun;

$mns = Aliyun::createClient('mns');    
$ret = $mns->SendSMSMessage(13888888888,'SMS_14695416',['customer'=>'测试']);   
// 成功返回 True, 失败返回False

目前支持的阿里云服务

目前支持下列服务:

服务名 类名 API 版本 服务介绍
Aliyun OSS   ALY.OSS 2017-09-01 OSS
Aliyun MNS   ALY.MNS 2017-09-01 MNS
Aliyun CDN   ALY.CDN 2017-09-01 CDN
Aliyun Memcache ALY.Memcache 2017-09-01 Memcache

使用过程中发现问题,发送issues。

License

This SDK is distributed under the Apache License, Version 2.0.

About

提供阿里云 OSS、MNS(含SMS短信消息)、memcached等服务接口,适用于Laravel、Symfony、TinyLara等所有支持composer的PHP框架。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages