Link Model (#15611)

* Link Model
and relationships

* Some uses of the new model
This commit is contained in:
Tony Murray
2023-12-15 10:13:10 -06:00
committed by GitHub
parent 648a5ea7d3
commit c79d8665d8
4 changed files with 73 additions and 2 deletions

View File

@@ -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