mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
More cleanups (#12715)
* PHPDoc * Replace Auth > Illuminate\Support\Facades\Auth * Return inside when() * use str_replace correct * Misc * dead code * use int $port * styleci
This commit is contained in:
@@ -200,10 +200,10 @@ class FdbTablesController extends TableController
|
||||
|
||||
return Ipv4Mac::where('ipv4_address', 'like', "%$ip%")
|
||||
->when($device_id, function ($query) use ($device_id) {
|
||||
$query->where('device_id', $device_id);
|
||||
return $query->where('device_id', $device_id);
|
||||
})
|
||||
->when($port_id, function ($query) use ($port_id) {
|
||||
$query->where('port_id', $port_id);
|
||||
return $query->where('port_id', $port_id);
|
||||
})
|
||||
->pluck('mac_address');
|
||||
}
|
||||
@@ -219,10 +219,10 @@ class FdbTablesController extends TableController
|
||||
|
||||
return Vlan::where('vlan_vlan', $vlan)
|
||||
->when($device_id, function ($query) use ($device_id) {
|
||||
$query->where('device_id', $device_id);
|
||||
return $query->where('device_id', $device_id);
|
||||
})
|
||||
->when($port_id, function ($query) use ($port_id) {
|
||||
$query->whereIn('device_id', function ($query) use ($port_id) {
|
||||
return $query->whereIn('device_id', function ($query) use ($port_id) {
|
||||
$query->select('device_id')->from('ports')->where('port_id', $port_id);
|
||||
});
|
||||
})
|
||||
@@ -240,10 +240,10 @@ class FdbTablesController extends TableController
|
||||
|
||||
return Port::where('ifAlias', 'like', "%$ifAlias%")
|
||||
->when($device_id, function ($query) use ($device_id) {
|
||||
$query->where('device_id', $device_id);
|
||||
return $query->where('device_id', $device_id);
|
||||
})
|
||||
->when($port_id, function ($query) use ($port_id) {
|
||||
$query->where('port_id', $port_id);
|
||||
return $query->where('port_id', $port_id);
|
||||
})
|
||||
->pluck('port_id');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user