$this->account->orders($request->user(), 15), ]); } public function show(string $locale, Request $request, int $orderId): View { try { $order = $this->account->order($request->user(), $orderId); } catch (OrderNotFoundException) { abort(404); } // By type, like the checkout confirmation: the method may since have // been disabled, but the order still shows what was used. $paymentMethodName = PaymentMethod::where('type', $order->meta['payment_method'] ?? null) ->first() ?->translate('name'); return view('account.orders.show', [ 'order' => $order, 'paymentMethodName' => $paymentMethodName, // Active shipments with a number; return vouchers are the shop's // business, not the customer's. 'shipments' => $order->shipments ->reject(fn ($shipment) => $shipment->isCancelled() || $shipment->isReturn() || blank($shipment->tracking_reference)) ->values(), ]); } }