Add datastore_id to OS model and related functionality; update validation and relationships
This commit is contained in:
@@ -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']){
|
||||
|
||||
Reference in New Issue
Block a user