let's say I've this kind of structure.
| lines | | products | | orders |
|------------| |----------| |--------|
| id | | id | | id |
| product_id | |----------| |--------|
| order_id |
|------------|
Is there a way in Laravel Eloquent to load related products given an order? I've tried with hasManyThrough(Product::class, Line::class) with no luck, because on products table there's no reference to the order. Is there a method that can resolve this relationship or should I write a raw query?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35IXJA0
via IFTTT
Aucun commentaire:
Enregistrer un commentaire