@php $total = collect($groupedPermissions)->flatten()->count(); $isSuperadmin = $role->name === 'superadmin'; @endphp
{{-- ============================ HEADER ============================ --}}

{{ __(ucfirst(str_replace('_', ' ', $role->name))) }}

{{ $role->name }} · {{ __('Rank') }} {{ config("roles.hierarchy.{$role->name}", 0) }}
{{ count($granted) }}/{{ $total }}
{{ __('Permissions') }}
{{ $usersAffected }}
{{ __('Users with this role') }}
{{-- ============================ READ-ONLY NOTICE ============================ --}} {{-- The screen is a viewer on purpose: PermissionSeeder is the source of truth and the deploy re-runs it, so anything edited here would be reverted without warning. --}} @if ($isSuperadmin) @endif {{-- ============================ GROUPS ============================ --}} @foreach ($groupedPermissions as $group => $permissions) @php $names = collect($permissions)->pluck('name'); $grantedInGroup = $names->intersect($granted)->count(); $allGranted = $grantedInGroup === $names->count(); @endphp
{{ __($group) }} {{ $grantedInGroup }}/{{ $names->count() }}
@foreach ($permissions as $permission) @php $isGranted = in_array($permission->name, $granted, true); $isSensitive = in_array($permission->name, $sensitive, true); $isEssential = in_array($permission->name, $essential, true); @endphp
{{-- Icon instead of a switch: nothing here is clickable. --}}
{{ $permission->description ?: $permission->name }} {{ $permission->name }} @if ($isSensitive) {{ __('Sensitive') }} @endif @if ($isEssential) {{ __('Essential') }} @endif
@endforeach
@endforeach