show count of Ports in PortGroup display (#13164)

This commit is contained in:
SourceDoctor
2021-08-24 02:06:36 +02:00
committed by GitHub
parent d74bb37971
commit 62d440a0dc
2 changed files with 3 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ class PortGroupController extends Controller
public function index()
{
return view('port-group.index', [
'port_groups' => PortGroup::orderBy('name')->get(),
'port_groups' => PortGroup::orderBy('name')->withCount('ports')->get(),
]);
}

View File

@@ -22,6 +22,7 @@
<tr>
<th>@lang('Name')</th>
<th>@lang('Description')</th>
<th>@lang('Ports')</th>
<th>@lang('Actions')</th>
</tr>
</thead>
@@ -30,6 +31,7 @@
<tr id="row_{{ $port_group->id }}">
<td>{{ $port_group->name }}</td>
<td>{{ $port_group->desc }}</td>
<td>{{ $port_group->ports_count }}</td>
<td>
<a type="button" title="@lang('edit Port Group')" class="btn btn-primary btn-sm" aria-label="@lang('Edit')"
href="{{ route('port-groups.edit', $port_group->id) }}">