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:
@@ -48,7 +48,7 @@ class Component
|
||||
public function getComponentCount($device_id = null)
|
||||
{
|
||||
$counts = \App\Models\Component::query()->when($device_id, function ($query, $device_id) {
|
||||
$query->where('device_id', $device_id);
|
||||
return $query->where('device_id', $device_id);
|
||||
})->selectRaw('type, count(*) as count')->groupBy('type')->pluck('count', 'type');
|
||||
|
||||
return $counts->isEmpty() ? false : $counts->all();
|
||||
|
Reference in New Issue
Block a user