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
+11
View File
@@ -103,6 +103,17 @@ class Product extends Model
return $this->belongsToMany(ProductCategories::class, 'product_product_category', 'product_id', 'product_category_id');
}
/**
* Relationship: Product has many addons (through product type)
* Addons are linked via type_id in product_addon table
*/
public function addons()
{
// Assuming product_addon has type_id field that links to product type
return $this->hasMany(Addon::class, 'type_id', 'product_type')
->orderBy('sort_order');
}
/**
* Get monthly pricing (or first available pricing)
*/