예제 #1
0
 public function getItems(Request $request)
 {
     $items = OrderItem::with('product')->where('order_id', $request->get('order_id'))->get();
     return json_encode($items);
 }
예제 #2
0
 protected function saveOrderItem($producto, $order_id)
 {
     OrderItem::create(['price' => $producto->price, 'quantity' => 1, 'product_id' => $producto->id, 'order_id' => $order_id]);
 }