feat: implement VM snapshot management, enhance client resource loading, and refactor deployment workflow for production

This commit is contained in:
pbao9
2026-05-11 11:09:55 +07:00
parent 8aef607e1f
commit 96778e7bed
51 changed files with 2536 additions and 1249 deletions
+10 -5
View File
@@ -33,6 +33,7 @@ class Product extends Model
'is_active',
'sort_order',
'product_categories_id',
'module_ip_address',
'published_at',
];
@@ -130,6 +131,11 @@ class Product extends Model
* Relationship: Product has many addons (through product type)
* Addons are linked via type in product_addon table
*/
public function ipAddress()
{
return $this->belongsTo(ModuleIpAddress::class, 'module_ip_address');
}
public function addons()
{
return $this->hasMany(Addon::class, 'type', 'product_type')
@@ -141,11 +147,10 @@ class Product extends Model
*/
public function getMonthlyPricingAttribute()
{
return $this->pricings()
->where('is_active', 1)
->where('billing_cycle', 'monthly')
->first()
?? $this->pricings()->where('is_active', 1)->orderBy('price')->first();
$pricings = $this->pricings;
return $pricings->firstWhere('billing_cycle', 'monthly')
?? $pricings->where('is_active', 1)->sortBy('price')->first();
}
/**