Files
librenms-librenms/app/Models/PortsFdb.php

31 lines
748 B
PHP
Raw Normal View History

<?php
namespace App\Models;
2021-03-30 11:14:34 +02:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
2021-03-30 11:14:34 +02:00
class PortsFdb extends PortRelatedModel
{
protected $table = 'ports_fdb';
protected $primaryKey = 'ports_fdb_id';
public $timestamps = true;
// ---- Define Relationships ----
2021-03-30 11:14:34 +02:00
public function device(): BelongsTo
{
return $this->belongsTo(\App\Models\Device::class, 'device_id', 'device_id');
}
2021-03-30 11:14:34 +02:00
public function vlan(): BelongsTo
{
return $this->belongsTo(\App\Models\Vlan::class, 'vlan_id', 'vlan_id');
}
public function ipv4Addresses(): HasMany
{
return $this->hasMany(\App\Models\Ipv4Mac::class, 'mac_address', 'mac_address');
}
}