Pivot columns #2468
georgeboot
started this conversation in
Ideas
Pivot columns
#2468
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the example of the bakery schema, how can I access pivot columns
price
andquantity
on thelineitem
pivot table?For example, Laravel allows you to define a n:n relation between orders and cakes, with additional columns.
Imagine I would implement an api response that shows orders. Currently, I can load the cakes for my orders, but that means I lose the additional 2 columns. I could make LineItem it's own relation, but then I can't use the
load_many
helper as its a relation of a relation.What is the best approach here?
In for example Laravel, I could do something like
Beta Was this translation helpful? Give feedback.
All reactions