feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.

This commit is contained in:
pbao9
2026-02-11 17:02:07 +07:00
parent 58a9aa685b
commit 556b2c02e6
47 changed files with 1367 additions and 497 deletions
+18
View File
@@ -64,4 +64,22 @@ class Cart extends Model
{
return $this->belongsTo(ProductPricings::class, 'product_pricing_id');
}
/**
* Relationship: Cart has many addons
*/
public function addons()
{
return $this->hasMany(CartAddon::class, 'cart_id');
}
/**
* Get total price including addons
*/
public function getTotalPriceAttribute()
{
$basePrice = $this->price * $this->quantity;
$addonsPrice = $this->addons->sum('price');
return $basePrice + $addonsPrice;
}
}