請教:下面這段代碼收不到微信公眾號回復(fù)用戶消息:hello,請問怎么修改?
public function serve(Request $request){
$config = config('socialite.wechat');
$app = new Application($config);
$symfony_request = new SymfonyRequest($request->get(), $request->post(), [], $request->cookie(), [], [], $request->rawBody());
$symfony_request->headers = new HeaderBag($request->header());
$app->setRequestFromSymfonyRequest($symfony_request);//必須替換服務(wù)端請求
$server = $app->getServer();
$server->addMessageListener('text', function($message) {
return 'hello';
});
$response = $server->serve();
return response($response->getBody()->getContents());
}