I am new to using Eloquent & Laravel in general.
Here is my current situation :
I have two more tables.
order
and order_product_variant
which you have guessed right, links Orders to Product variants through the pivot table order_product_variant
.
Now, I am attempting to retrieve all the order
that that have a product_variant
with a product
that itself has a specific company.id
I have tried with where
and with
function of Eloquent, but I am not successful at all.
I am now wondering if I shouldn’t use raw SQL for that, which I absolutely don’t want to unless it is the very last resort.