php - Update the order items in in laravel 5.5
Get the solution ↓↓↓Solution:
You have written wrong code for the update.it should be like this.
You are saving$orderItems
object which hasn't updated in your code.
$items= $order->orderItems;
// still code not updated here i want to print product _id ?
foreach($items as $key => $item) {
$item->product_id = $request->input('product_id')[$key];
$item->product_code = $request->input('product_code')[$key];
$item->product_name = $request->input('product_name')[$key];
$item->cost = $request->input('cost')[$key];
$item->quantity = $request->input('quantity')[$key];
$item->total_cost = (float) str_replace(',', '', $request->input('total_cost')[$key]);
$item->save();
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: a non-numeric value encountered in
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.