Replies: 1 comment 6 replies
-
See hasManyThrough https://laravel.com/docs/10.x/eloquent-relationships#has-many-through |
Beta Was this translation helpful? Give feedback.
6 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following scenario:
Is there any way I can load the coin of a line as a relation in the orders? The idea is to do
$order->coin()
(similar to whathasOneThrough
does).I'd also need to filter the lines from which i'd get the coin, for example, get the coin from the first line with type "A" (
$order->coinA()
).I want it to be a relationship since I need it to be lazy loaded.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions