{{-- نموذج الدور المشترك بين الإضافة والتعديل --}} @php $isAdmin = $role && $role->name === 'Admin'; $checked = array_map('intval', old('permission', $rolePermissions ?? [])); $total = collect($groups)->sum(fn ($g) => count($g['items'])); @endphp @if ($errors->any())