listen/ali-openapi

阿里Openali包

1.1.4 2019-03-19 06:25 UTC

This package is auto-updated.

Last update: 2024-09-19 19:53:13 UTC


README

Laravel5 的 Ali Openapi 包

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

用法

composer install

composer require "listen/ali-openapi"

发布配置

php artisan publish

更新 config/app.php

providers => [
    ......
    Listen\AliOpenapi\AliOpenapiServiceProvider::class,
],

......

aliases => [
    ......
    'AliOpenapi' => Listen\AliOpenapi\Facades\AliOpenapi::class,
] 

getToken

dd(AliOpenapi::getToken());

更新 .env

# aliyun 配置
ALI_ACCESS_KEY_ID=xxxxxx
ALI_ACCESS_KEY_SECRET=xxxxxx

设置异常通知

\AliOpenapi::pushExceptionCallback('dingtalk', function ($module, $message, $code, $otherParams) {
            // https://github.com/listen-rain/dingtalk
            sendByDingtalk($message . "\n\n Code: {$code}", "{$module}.error");
        });