feat: Implement payment method fields, refactor order creation logic to support detailed order items and VM provisioning, and add admin notifications.

This commit is contained in:
pbao9
2026-03-11 10:14:32 +07:00
parent 7fdcc01027
commit 5649674eb4
9 changed files with 208 additions and 61 deletions
+2 -11
View File
@@ -25,20 +25,11 @@ class OrderItem extends Model
public function getProductAttribute()
{
// New flow: Check if product exists in Product table first
if ($this->product_id) {
$product = Product::find($this->product_id);
if ($product) {
return $product;
}
return Product::find($this->product_id);
}
// Legacy flow: fallback to old system
return match ($this->product_type) {
3 => Hosting::find($this->product_id),
4 => Vps::find($this->product_id),
default => null,
};
return null;
}
/**