$this->id, 'store_id' => $this->store_id, 'store' => StoreResource::make($this->whenLoaded('store')), 'payload' => $this->payload, 'remark' => $this->remark, 'coupon_id' => $this->coupon_id, 'coupon' => UserCouponResource::make($this->whenLoaded('coupon')), 'order' => OfflineOrderResource::make($this->whenLoaded('order')), 'created_at' => $this->created_at?->format('Y-m-d H:i:s'), 'orders' => OfflineOrderResource::collection($this->whenLoaded('orders')), 'qrcode' => $this->qrcode, ]; } }