@extends('admin.layouts.master') @section('title', __('admin.permissions') . ' — ' . $role->name) @section('page_title', __('admin.permissions') . ': ' . $role->name) @section('breadcrumbs') @endsection @php $isProtected = $role->name === 'super-admin'; @endphp @section('content') @if($isProtected)
دور super-admin دائماً يحمل كل الصلاحيات ولا يمكن تعديله.
@endif
@csrf @method('PUT')
@can('roles.edit') @endcan
@foreach($allPermissions as $module => $perms) @php $moduleLabel = __('admin.'.$module); $moduleAssigned = $perms->whereIn('id', $assignedIds)->count(); @endphp
{{ str_starts_with($moduleLabel, 'admin.') ? ucfirst($module) : $moduleLabel }} ({{ $moduleAssigned }}/{{ $perms->count() }})
@foreach($perms as $perm) @php $action = explode('.', $perm->name)[1] ?? $perm->name; @endphp
id, $assignedIds) ? 'checked' : '' }} {{ $isProtected ? 'disabled' : '' }}>
@endforeach
@endforeach
@endsection @push('scripts') @endpush