[Vuejs]-I have product_id inside line_items array in order table, I want to show product name against this product_id in laravel using vue.js

0👍

Try to eager load the relation:

return response()->json([ 'orders' => $order->load('product') ]);

After that (assuming the order belongs to a product), you can show the product name in Vue like this:

{{ order.product.name }} 

Leave a comment