mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* 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.
33 lines
688 B
PHP
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');
|
|
}
|
|
}
|