hachi-zzq/laravel-wechat-third-work

企业号第三方SDK for Laravel

v1.0.6 2018-04-03 02:05 UTC

This package is auto-updated.

Last update: 2024-04-09 02:40:57 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();