2019-01-20 08:43:36 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2021-03-30 11:14:34 +02:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2023-09-25 19:49:22 -05:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2021-03-30 11:14:34 +02:00
|
|
|
|
2019-01-22 17:04:28 -06:00
|
|
|
class PortsFdb extends PortRelatedModel
|
2019-01-20 08:43:36 -06:00
|
|
|
{
|
|
|
|
protected $table = 'ports_fdb';
|
|
|
|
protected $primaryKey = 'ports_fdb_id';
|
2019-02-21 13:23:01 +01:00
|
|
|
public $timestamps = true;
|
2019-01-20 08:43:36 -06:00
|
|
|
|
|
|
|
// ---- Define Relationships ----
|
|
|
|
|
2021-03-30 11:14:34 +02:00
|
|
|
public function device(): BelongsTo
|
2019-01-20 08:43:36 -06:00
|
|
|
{
|
2020-04-21 14:28:48 +02:00
|
|
|
return $this->belongsTo(\App\Models\Device::class, 'device_id', 'device_id');
|
2019-01-20 08:43:36 -06:00
|
|
|
}
|
|
|
|
|
2021-03-30 11:14:34 +02:00
|
|
|
public function vlan(): BelongsTo
|
2019-01-20 08:43:36 -06:00
|
|
|
{
|
2020-04-21 14:28:48 +02:00
|
|
|
return $this->belongsTo(\App\Models\Vlan::class, 'vlan_id', 'vlan_id');
|
2019-01-20 08:43:36 -06:00
|
|
|
}
|
2023-09-25 19:49:22 -05:00
|
|
|
|
|
|
|
public function ipv4Addresses(): HasMany
|
|
|
|
{
|
2024-02-14 14:06:41 +01:00
|
|
|
return $this->hasMany(\App\Models\Ipv4Mac::class, 'mac_address', 'mac_address');
|
2023-09-25 19:49:22 -05:00
|
|
|
}
|
2019-01-20 08:43:36 -06:00
|
|
|
}
|