???? 'integer', 'is_guest' => 'boolean', 'customer_type' => 'string', 'payment_status' => 'string', 'order_status' => 'string', 'payment_method' => 'string', 'transaction_ref' => 'string', 'payment_by' => 'string', 'payment_note' => 'string', 'order_amount' => 'double', 'admin_commission' => 'decimal:2', 'is_pause' => 'boolean', 'cause' => 'string', 'shipping_address' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'discount_amount' => 'double', 'discount_type' => 'string', 'coupon_code' => 'string', 'coupon_discount_bearer' => 'string', 'shipping_responsibility' => 'string', 'shipping_method_id' => 'integer', 'shipping_cost' => 'double', 'is_shipping_free' => 'boolean', 'order_group_id' => 'string', 'verification_code' => 'string', 'verification_status' => 'boolean', 'seller_id' => 'integer', 'seller_is' => 'string', 'shipping_address_data' => 'object', 'delivery_man_id' => 'integer', 'deliveryman_charge' => 'double', 'order_note' => 'string', 'billing_address' => 'integer', 'billing_address_data' => 'object', 'order_type' => 'string', 'extra_discount' => 'double', 'extra_discount_type' => 'string', 'free_delivery_bearer' => 'string', 'checked' => 'boolean', 'shipping_type' => 'string', 'delivery_type' => 'string', 'delivery_service_name' => 'string', 'third_party_delivery_tracking_id' => 'string', ]; public function details() : HasMany { return $this->hasMany(OrderDetail::class)->orderBy('seller_id', 'ASC'); } public function seller(): BelongsTo { return $this->belongsTo(Seller::class); } public function sellerName() : HasOne { return $this->hasOne(OrderDetail::class); } public function customer(): BelongsTo { return $this->belongsTo(User::class, 'customer_id'); } public function shipping(): BelongsTo { return $this->belongsTo(ShippingMethod::class, 'shipping_method_id'); } public function shippingAddress(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'shipping_address'); } public function billingAddress(): BelongsTo { return $this->belongsTo(ShippingAddress::class, 'billing_address'); } public function deliveryMan(): BelongsTo { return $this->belongsTo(DeliveryMan::class,'delivery_man_id'); } /* delivery_man_review -> deliveryManReview */ public function deliveryManReview():HasOne { return $this->hasOne(Review::class,'order_id')->whereNotNull('delivery_man_id'); } /* order_transaction -> orderTransaction */ public function orderTransaction() : HasOne { return $this->hasOne(OrderTransaction::class, 'order_id'); } public function coupon():BelongsTo { return $this->belongsTo(Coupon::class, 'coupon_code', 'code'); } /* order_status_history -> orderStatusHistory */ public function orderStatusHistory():HasMany { return $this->hasMany(OrderStatusHistory::class); } /* order_details -> orderDetails */ public function orderDetails() : HasMany { return $this->hasMany(OrderDetail::class, 'order_id'); } /* offline_payments -> offlinePayments */ public function offlinePayments() : BelongsTo { return $this->belongsTo(OfflinePayments::class, 'id', 'order_id'); } /* verification_images -> verificationImages */ public function verificationImages(): HasMany { return $this->hasMany(OrderDeliveryVerification::class,'order_id'); } protected static function boot(): void { parent::boot(); //static::addGlobalScope(new RememberScope); } }