Files
librenms-librenms/app/Models/PortsFdb.php
Tony Murray ef41c9fd7d Refactor FDB Tables to Laravel (#9669)
* Refactor FDB Tables to Laravel
Hopefully much better performance with large tables.
Better dns resolution (limit to 4 IPs tried per MAC)

* update style

* de-duplicate IPs

* fixed column width for mac and vlan

* Make DNS column visibility control whether or not we send the dns query.
Hide that column by default.
2019-01-20 08:43:36 -06:00

33 lines
688 B
PHP

<?php
namespace App\Models;
class PortsFdb extends BaseModel
{
protected $table = 'ports_fdb';
protected $primaryKey = 'ports_fdb_id';
public $timestamps = false;
public function scopeHasAccess($query, User $user)
{
return $this->hasPortAccess($query, $user);
}
// ---- Define Relationships ----
public function device()
{
return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
}
public function port()
{
return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
}
public function vlan()
{
return $this->belongsTo('App\Models\Vlan', 'vlan_id', 'vlan_id');
}
}