@foreach ($groupNames as $group)
@foreach ($tableNames as $table)
@php
$permission = $existingPermissions->has($table) ? $existingPermissions[$table] : null;
$tableGroup = $urlToGroupName[$table] ?? 'Other';
@endphp
@if($tableGroup == $group)
@endif
@endforeach
@endforeach