Open liyu001989 opened 5 years ago
Models:
$availableIncludes = ['user'];
$availableIncludes = ['user', 'topic'];
user has many Topics,Tpoic has many replies。when I request /api/replies?include=topic.user
/api/replies?include=topic.user
only topic eagered,becase those codes : https://github.com/dingo/api/blob/v2.0.0/src/Transformer/Adapter/Fractal.php#L93-L96
just load topic。
topic.user will be eagered
topic.user
There is a public repo: https://github.com/summerblue/larabbs/tree/api
ReplyTransformer: https://github.com/summerblue/larabbs/blob/api/app/Transformers/ReplyTransformer.php
Did you try topic.user inside the $availableIncludes array?
Actual Behaviour
Models:
$availableIncludes = ['user'];
$availableIncludes = ['user', 'topic'];
user has many Topics,Tpoic has many replies。when I request
/api/replies?include=topic.user
only topic eagered,becase those codes : https://github.com/dingo/api/blob/v2.0.0/src/Transformer/Adapter/Fractal.php#L93-L96
just load topic。
Expected Behaviour
topic.user
will be eageredSteps to Reproduce
There is a public repo: https://github.com/summerblue/larabbs/tree/api
ReplyTransformer: https://github.com/summerblue/larabbs/blob/api/app/Transformers/ReplyTransformer.php