Add datastore_id to OS model and related functionality; update validation and relationships

This commit is contained in:
baodev0
2026-07-21 11:10:45 +07:00
parent c3b5417b19
commit 2d43e95855
9 changed files with 69 additions and 15 deletions
+6
View File
@@ -16,6 +16,7 @@ class Os extends Model
'os_group_id',
'template_id',
'module_host_id',
'datastore_id',
'status',
];
@@ -28,6 +29,11 @@ class Os extends Model
{
return $this->belongsTo(\App\Models\ModuleHost::class, 'module_host_id');
}
public function datastore()
{
return $this->belongsTo(\App\Models\ModuleDatastore::class, 'datastore_id');
}
public function getStatus()
{
return match ($this->attributes['status']){