Add all files
This commit is contained in:
59
extensions/Servers/Proxmox/Models/Server.php
Normal file
59
extensions/Servers/Proxmox/Models/Server.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Paymenter\Extensions\Servers\Proxmox\Models;
|
||||
|
||||
use App\Models\Service;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Server extends Model
|
||||
{
|
||||
protected $table = 'ext_proxmox_servers';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'node_id',
|
||||
'os_id',
|
||||
'service_id',
|
||||
'vm_id',
|
||||
'primary_ipv4',
|
||||
'primary_ipv6',
|
||||
'status',
|
||||
'hostname',
|
||||
'password',
|
||||
];
|
||||
|
||||
public function node()
|
||||
{
|
||||
return $this->belongsTo(Node::class);
|
||||
}
|
||||
|
||||
public function os()
|
||||
{
|
||||
return $this->belongsTo(OS::class);
|
||||
}
|
||||
|
||||
public function ipAddresses()
|
||||
{
|
||||
return $this->hasMany(IPAddress::class);
|
||||
}
|
||||
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo(Service::class);
|
||||
}
|
||||
|
||||
public function primaryIpv4()
|
||||
{
|
||||
return $this->belongsTo(IPAddress::class, 'primary_ipv4');
|
||||
}
|
||||
|
||||
public function primaryIpv6()
|
||||
{
|
||||
return $this->belongsTo(IPAddress::class, 'primary_ipv6');
|
||||
}
|
||||
|
||||
public function statistics()
|
||||
{
|
||||
return $this->hasMany(ServerStatistics::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user