@extends('backend.layouts.app') @section('title', __('Roles')) @push('styles') @endpush @section('content')
{{ __('Access Control') }}

{{ __('Roles & Permissions') }}

{{ __('Define scoped access, manage staff, and lock down sensitive areas.') }}

{{ number_format($summary['totalRoles'] ?? $roles->total()) }} {{ __('Total Roles') }}
{{ number_format($summary['assignedStaff'] ?? 0) }} {{ __('Assigned Staff') }}
@can('role-create') {{ __('Add New') }} @endcan
@forelse($roles as $role) @php $isProtected = $role->name === 'super-admin'; $currentRoleName = auth()->user()?->roles?->first()?->name; $staffCount = (int) $role->users_count; @endphp @empty @endforelse
{{ __('Role') }} {{ __('Status') }} {{ __('Permissions') }} {{ __('Staff') }} {{ __('Actions') }}
{{ title($role->name) }} {{ $role->description ?: __('Operational access role') }}
{{ $isProtected ? __('Protected') : __('Custom') }} {{ number_format((int) $role->permissions_count) }}
@if($staffCount > 0)
@foreach($role->users->take(3) as $user) {{ $user->name ?? __('Staff') }} @endforeach @if($staffCount > 3) +{{ $staffCount - 3 }} @endif
{{ number_format($staffCount) }} {{ trans_choice('member|members', $staffCount) }} @else {{ __('Unassigned') }} @endif
@if(! $isProtected) @can('role-edit') {{ __('Manage') }} @endcan @can('role-delete') @if($currentRoleName !== $role->name) {{ __('Delete') }} @endif @endcan @else {{ __('Protected') }} @endif
@if($roles->hasPages())
{{ $roles->links() }}
@endif
@endsection