mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Link Model (#15611)
* Link Model and relationships * Some uses of the new model
This commit is contained in:
@@ -26,13 +26,16 @@
|
||||
namespace App\Http\Controllers\Device\Tabs;
|
||||
|
||||
use App\Models\Device;
|
||||
use App\Models\Link;
|
||||
use LibreNMS\Interfaces\UI\DeviceTab;
|
||||
|
||||
class NeighboursController implements DeviceTab
|
||||
{
|
||||
public function visible(Device $device): bool
|
||||
{
|
||||
return \DB::table('links')->where('local_device_id', $device->device_id)->exists();
|
||||
return Link::where('local_device_id', $device->device_id)
|
||||
->orWhere('remote_device_id', $device->device_id)
|
||||
->exists();
|
||||
}
|
||||
|
||||
public function slug(): string
|
||||
|
Reference in New Issue
Block a user