I use query builder for execution inquiries to db like as:
$result = Order::with("product", "images");
As result I get response with two nested objects inside:
{["product" : [{}], "images" : [{}]]}
How can I join these two objects to one, that to get the following response:
{"title" : "Product name", "price" : 3, "images" :{}, "order" : {} }
OrderandProductis:Order.product_id = Product.idandProduct.image = images.id