chedianai/laravel-wechat-third-work

企业号第三方SDK for Laravel

v1.0.7 2018-05-29 07:49 UTC

This package is not auto-updated.

Last update: 2019-07-29 04:00:17 UTC


README

author:zhuzhengqianhachi.zzq@gmail.com

使用示例

<?php
    use hachi\LaravelWechatThirdWork\Application;

//配置
   $config = [
        'corp_id' => 'corp_id',
        'agent_id' => 'agent_id', // 如果有 agend_id 则填写
        // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
        'response_type' => 'collection',
        'permanent_code'=>'permanent_code',
        'suite_id'=>'suite_id',//套件ID
        'suite_secret'=>'suite_secret',//套件的secret
        'suite_ticket'=>'suite_ticket',//套件的ticket
        'provider_secret'=>'provider_secret',//单点登录、注册定制化 等需要用的 provider_secret
        'log' => [
            'level' => 'debug',
            'file'  => storage_path('logs/wechat.log'),
        ],
    ];

    $wechatThirdWork = Application::make($config);
    
    //使用
    
    //getSuiteAccessToken
    $wechatThirdWork->open_platform->getSuiteAccessToken();
    
    //getToken by permanenttCode
    $wechatThirdWork->open_platform->getCorpAccessTokenByPermanentCode();