Answer the question
In order to leave comments, you need to log in
Laravel Eloquent how to get values from 3rd table?
Need help creating a
Table query:
items
-id
-order_id
orders
-id
-invoice_id
invoices
-id
-email
$items = Items::with(['order'])->get();
Answer the question
In order to leave comments, you need to log in
$items = Items::with(['order' => function($q){
$q->with('invoice');
}])->get();
It's not clear what kind of structure you want to end up with, but if the solution from Ramm 's answer doesn't work for you, set up a Has Many Through relationship .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question