*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'status' => OrderStatus::formattedStatusFor($this->status), 'shipping_method' => $this->formattedShippingMethod(), 'notes' => $this->notes, 'customer_name' => $this->customer_name, 'customer_phone' => $this->customer_phone, 'customer_address' => $this->customer_address, 'delivery_time' => $this->delivery_time, 'delivery_at' => $this->delivery_at, 'region' => $this->region, 'user_id' => $this->user_id, 'province_id' => $this->province_id, 'payment_type' => $this->paymentType?->name, 'orderItems' => OrderItemResource::collection($this->whenLoaded('items')), ]; } }