How to Access a Junction Table via Entity Loader? #3079
Unanswered
thetwistedlogic
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say, I have a database designed like so:
mediahas a many to many relationship with thetagtablemedia_tag, the junction table, has extra metadata specific to the relation within it (such as whether the tag is a spoiler)Here is how I've designed the tables:
Here is how I query the data using Entity Loader:
This returns a vector of
entity::media::ModelEx, which has each media object as well as their associate tags as an array. This is excellent but it misses the metadata from the junction table! Is there something I'm missing, perhaps an alternative method that isn't.with()?Beta Was this translation helpful? Give feedback.
All reactions