-
Hey, I think the serializer would solve my problem but I found the documentation quite vague, so I'll explain what my need. I have a manyThrough relation ship in a model, like: Picture taken in a ---> Location who belongs to a --> Country. How can I do this ? |
Beta Was this translation helpful? Give feedback.
Answered by
sanconley
Nov 6, 2020
Replies: 1 comment
-
You can set up the manyThrough in reverse. // Country.js
pictures () {
return this.manyThrough('App/Models/Picture', 'location')
}
// Controller somewhere
const pictures = await Country.query().with('pictures').fetch() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Neewd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can set up the manyThrough in reverse.