45 lines
866 B
PHP
45 lines
866 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\LogsActivity;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class VirtualMachines extends Model
|
|
{
|
|
use HasFactory, LogsActivity;
|
|
|
|
protected $fillable = [
|
|
'uuid',
|
|
'vm_id',
|
|
'name',
|
|
'power_state',
|
|
'folder',
|
|
'is_template',
|
|
'cpu',
|
|
'ram_mb',
|
|
'is_system',
|
|
'last_synced_at',
|
|
'datacenter_id',
|
|
'host_id',
|
|
'ip_pool_id',
|
|
'ip',
|
|
];
|
|
|
|
public function datacenter()
|
|
{
|
|
return $this->belongsTo(ModuleDatacenter::class, 'datacenter_id');
|
|
}
|
|
|
|
public function host()
|
|
{
|
|
return $this->belongsTo(ModuleHost::class, 'host_id');
|
|
}
|
|
|
|
public function ipPool()
|
|
{
|
|
return $this->belongsTo(IpPool::class, 'ip_pool_id');
|
|
}
|
|
}
|