docs/src/6.x/mini-app/examples.md
<details open> <summary>生成小程序码(wxacode.getUnlimited)</summary>👏🏻 欢迎点击本页下方 "帮助我们改善此页面!" 链接参与贡献更多的使用示例!
try {
$response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
'scene' => '123',
'page' => 'pages/index/index',
'width' => 430,
'check_path' => false,
]);
$path = $response->saveAs('/tmp/wxacode-123.png');
} catch (\Throwable $e) {
// 失败
echo $e->getMessage();
}
官方文档:phonenumber.getPhoneNumber
// routes/api.php
use EasyWeChat\MiniApp\Application;
Route::post('getPhoneNumber', function () {
// $app 实例化步骤这里省略
$data = [
'code' => (string) request()->get('code'),
];
return $app->getClient()->postJson('wxa/business/getuserphonenumber', $data);
}
}