for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the overtrue/wechat.
*
* (c) overtrue <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\MiniProgram;
use EasyWeChat\Kernel\BaseClient;
/**
* Class Client.
* @author Keal <[email protected]>
class Client extends BaseClient
{
* 获取公众号关联的小程序.
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
public function list()
return $this->httpPostJson('cgi-bin/wxopen/wxamplinkget');
}
* 关联小程序.
* @param string $appId
* @param bool $notifyUsers
* @param bool $showProfile
public function link(string $appId, bool $notifyUsers = true, bool $showProfile = false)
$params = [
'appid' => $appId,
'notify_users' => (string) $notifyUsers,
'show_profile' => (string) $showProfile,
];
return $this->httpPostJson('cgi-bin/wxopen/wxamplink', $params);
* 解除已关联的小程序.
public function unlink(string $appId)
return $this->httpPostJson('cgi-bin/wxopen/wxampunlink', $params);