feat: implement VM snapshot management, enhance client resource loading, and refactor deployment workflow for production
This commit is contained in:
+10
-5
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user