@if($version->assignments && count($version->assignments) > 0)

Assignments

Captured with this version on {{ $version->captured_at->format('M d, Y H:i') }}

Summary

{{ count($version->assignments) }} assignment(s) @php $hasOrphaned = $version->metadata['has_orphaned_assignments'] ?? false; @endphp @if($hasOrphaned) (includes orphaned groups) @endif

@php $scopeTags = $version->scope_tags['names'] ?? []; @endphp @if(!empty($scopeTags))

Scope Tags

@foreach($scopeTags as $tag) {{ $tag }} @endforeach
@endif

Assignment Details

@foreach($version->assignments as $assignment) @php $target = $assignment['target'] ?? []; $type = $target['@odata.type'] ?? 'unknown'; $intent = $assignment['intent'] ?? 'apply'; $typeName = match($type) { '#microsoft.graph.groupAssignmentTarget' => 'Include group', '#microsoft.graph.exclusionGroupAssignmentTarget' => 'Exclude group', '#microsoft.graph.allLicensedUsersAssignmentTarget' => 'All Users', '#microsoft.graph.allDevicesAssignmentTarget' => 'All Devices', default => 'Unknown' }; $groupId = $target['groupId'] ?? null; $groupName = $target['group_display_name'] ?? null; $groupOrphaned = $target['group_orphaned'] ?? ($version->metadata['has_orphaned_assignments'] ?? false); $filterId = $target['deviceAndAppManagementAssignmentFilterId'] ?? null; $filterType = $target['deviceAndAppManagementAssignmentFilterType'] ?? 'none'; $filterName = $target['assignment_filter_name'] ?? null; @endphp
{{ $typeName }} @if($groupId) : @if($groupOrphaned) ⚠️ Unknown group (ID: {{ $groupId }}) @elseif($groupName) {{ $groupName }} ({{ $groupId }}) @else Group ID: {{ $groupId }} @endif @endif @if($filterId && $filterType !== 'none') Filter ({{ $filterType }}): {{ $filterName ?? $filterId }} @endif ({{ $intent }})
@endforeach
@else

Assignments

Assignments were not captured for this version.

@php $hasBackupItem = $version->policy->backupItems() ->whereNotNull('assignments') ->where('created_at', '<=', $version->captured_at) ->exists(); @endphp @if($hasBackupItem)

💡 Assignment data may be available in related backup items.

@endif
@endif