<?php
namespace app\index\controller;

use EasyWeChat\Factory;

class Index
{
    public function index()
    {
        $config = [
            'app_id' => 'wx90636672********',
            'secret' => '8c2391e3ccfabee663************',
            'token'   => '****',
            // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
            'response_type' => 'array',

            'log' => [
                'level' => 'debug',
                'file' => __DIR__.'/../../wechat.log',
            ],
        ];

        $app = Factory::officialAccount($config);
        $response = $app->server->serve();
        $response->send(); // Laravel 里请使用:return $response;
    }
}

 

相关文章:

  • 2021-10-27
  • 2021-10-17
  • 2021-10-17
  • 2022-12-23
  • 2021-04-20
  • 2021-10-17
  • 2021-10-29
猜你喜欢
  • 2021-11-23
  • 2021-10-27
  • 2021-11-12
  • 2021-10-17
  • 2021-10-17
相关资源
相似解决方案