user() ->orders() ->latest() ->paginate(20); return view('public.account.orders.index', compact('orders')); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $order = auth()->user() ->orders() ->with(['products', 'coupon', 'taxes']) ->where('id', $id) ->firstOrFail(); return view('public.account.orders.show', compact('order')); } }