Enhance VM service management: add service_id and plain_password fields, sync service records, and update related migrations
This commit is contained in:
@@ -27,7 +27,11 @@ class ModuleVmware extends Model
|
||||
'vcenter_id',
|
||||
'os_id',
|
||||
'customer_id',
|
||||
'status'
|
||||
'status',
|
||||
'service_id',
|
||||
'ip',
|
||||
'dns',
|
||||
'plain_password',
|
||||
];
|
||||
|
||||
// NOTE: password must NOT use 'hashed' cast — it is a VM guest credential
|
||||
@@ -63,6 +67,12 @@ class ModuleVmware extends Model
|
||||
return $this->hasMany(\App\Models\Service::class, 'vm_id', 'vmware_id');
|
||||
}
|
||||
|
||||
/** Direct link via service_id FK (new). */
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Service::class, 'service_id');
|
||||
}
|
||||
|
||||
public function getStatus()
|
||||
{
|
||||
return match ($this->status) {
|
||||
|
||||
Reference in New Issue
Block a user