我正在尝试使用whenLoaded加载模型关系,如下所示:
Yard Resource
'latest_inspection' => new Inspection($this->whenLoaded('latestInspection'))
哪个工作正常,但在检查资源上还有一些其他关系不包括在内:
检查资源
'completed_tasks' => TaskResource::collection($this->whenLoaded('tasks')),
'feedings' => FeedResource::collection($this->whenLoaded('feeds')),
如何确保这些内容也会加载到Yard资源的latestInspection中?