36 lines
739 B
PHP
36 lines
739 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ModuleNetwork extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'module_network';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'type',
|
|
'network',
|
|
'module_host_id',
|
|
'status',
|
|
];
|
|
|
|
public function host()
|
|
{
|
|
return $this->belongsTo(\App\Models\ModuleHost::class,'module_host_id','id');
|
|
}
|
|
public function ipAddresses()
|
|
{
|
|
return $this->hasMany(\App\Models\ModuleIpAddress::class, 'module_network_id');
|
|
}
|
|
|
|
public function ipPools()
|
|
{
|
|
return $this->hasMany(\App\Models\IpPool::class, 'module_network_id');
|
|
}
|
|
}
|