laravel telescope如何记录其它插件的http请求
laravel telescope如何记录其它插件的http请求
比如我在项目中安装了overtrue/wechat包,包中封装了微信的各种请求方法,如何把这些请求记录记录到telescope中,就像直接使用 Laravel自带的Http类一样.
使用laravel自带Http请求
public function access_token()
{
$cache_name = "mini_access_token";
$access_token = Cache::get($cache_name);
if (!$access_token) {
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appid}&secret={$this->secret}";
$res = Http::get($url)->json();
$access_token = $res["access_token"];
Cache::put("mini_access_token", $access_token, $res["expires_in"]);
}
return $access_token;
}
请求会自动记录到telescope
HTTP Client 中,如果项目有其它第三方包封装了http请求,telescope
无法记录到请求,如何实现在telescope
中记录所有第三方包的请求记录
推荐文章: