order list update

This commit is contained in:
Abhishek Mali
2025-11-12 19:44:04 +05:30
parent 47711478a6
commit 5f477c03d0
5 changed files with 162 additions and 16 deletions

View File

@@ -59,10 +59,20 @@ class AdminOrderController extends Controller
return redirect()->back()->with('success', 'Order created successfully with ID: ' . $newOrderId);
}
public function show($id)
{
$order = Order::findOrFail($id);
return view('admin.orders_show', compact('order'));
$order = Order::with('markList')->findOrFail($id);
// Get the mark list associated with this order
$markList = $order->markList;
// Fetch the user using the customer_id from mark list
$user = null;
if ($markList && $markList->customer_id) {
$user = \App\Models\User::where('customer_id', $markList->customer_id)->first();
}
return view('admin.orders_show', compact('order', 'markList', 'user'));
}
}