diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index a860d201..6909cb83 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -392,7 +392,12 @@ class CustomerController extends Controller $order = Order::where('reference', '=', $reference) ->where('customer_id', Auth::guard('customer')->user()->id) ->firstOrFail(); - $magasin = Magasin::find($order->timeslot->magasin->id); + + if ($order->status_id == 1) { + $magasin = null; + } else { + $magasin = Magasin::find($order->timeslot->magasin->id); + } return view('customer.order-detail', compact('order', 'magasin')); }