@use('App\Enums\RoleName') @php $role ??= null; $isBuiltIn = $role !== null && RoleName::isBuiltIn($role->name); $selectedPermissions = old('permissions', $role?->permissions->pluck('name')->all() ?? []); @endphp
@if ($role)
{{ trans_choice('{0} No users have this role|{1} :count user has this role|[2,*] :count users have this role', $role->users()->count()) }}
@endif
@if ($isBuiltIn)
{{ RoleName::labelFor($role->name) }}

{{ __('Built-in roles cannot be renamed.') }}

@else

{{ __('A short name people will recognise, like Manager or Accountant.') }}

@endif

{{ __('Access') }}

{{ __('Tick what this role is allowed to do in each part of the app. Everyone can always open the dashboard and their own profile.') }}

{{-- One card per module. A module added in the code appears here as another card after Refresh. --}}
@foreach ($permissionGroups as $group => $permissions)
{{ Str::upper(Str::substr($group, 0, 1)) }}

{{ __($group) }}

{{ trans_choice('{1} :count permission|[2,*] :count permissions', count($permissions)) }}

@foreach ($permissions as $permission) @endforeach
@endforeach
{{ __('Cancel') }} @unless ($role) @endunless {{ $submitLabel }}