💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[danger] hidden() 隐藏关联属性 + 预载入默认显示关联数据的所有字段 ~~~ $data = self::with('comments')->select(); dump($data->toArray()); ~~~ ![](https://img.kancloud.cn/6c/d6/6cd665c3034b712e4385fbb4da2c7c2c_534x540.png) + 隐藏后的效果 ~~~ $data = self::with('comments') ->hidden(['comments.id']) ->select(); dump($data->toArray()); ~~~ ![](https://img.kancloud.cn/27/e8/27e82de802a49d763a5ade8e66fe42c3_363x488.png) + 隐藏多个关联数据的属性 ~~~ $data = self::with('comments') // 隐藏多个关联数据的属性 ->hidden(['comments' => ['id', 'aid']]) ->select(); dump($data->toArray()); ~~~ ![](https://img.kancloud.cn/60/e7/60e715fb08e11cea5776875c8176157f_378x406.png)