美文网首页LNMP集合PHP实战
在laravel5中使用阿里短信

在laravel5中使用阿里短信

作者: hyperbolaa | 来源:发表于2017-04-11 23:46 被阅读82次

    GitHub地址

    https://github.com/hyperbolaa/Alisms
    

    安装

    composer require  hyperbolaa/alisms dev-master
    

    laravel 配置

     'providers' => [
         // ...
         Hyperbolaa\Alisms\AlismsServiceProvider::class,
     ]   
    

    生成配置文件

    运行 `php artisan vendor:publish` 命令,
    发布配置文件到你的项目中。
    

    app代码使用

    $alisms = app('alisms.yun');//短信服务
    //$alisms = app('alisms.api');//云市场
    $flag = $alisms->send('register',12345678911,['code'=>'456789']);
    
    if($flag === true){
        //todo 发送成功处理
    }
    

    备注【阿里有两个短信API】

    短信服务接口文档

    云市场短信接口文档

    Related

    • Ylpay 基于laravel5的POS通支付
    • Alipay 基于laravel5的支付宝支付
    • Unionpay 基于laravel5的银联支付
    • Wechatpay 基于laravel5的微信支付

    相关文章

      网友评论

        本文标题:在laravel5中使用阿里短信

        本文链接:https://www.haomeiwen.com/subject/thjpattx.html