@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'] ?? ''; $typeKey = strtolower((string) $type); $intent = $assignment['intent'] ?? 'apply'; $typeName = match (true) { str_contains($typeKey, 'exclusiongroupassignmenttarget') => 'Exclude group', str_contains($typeKey, 'groupassignmenttarget') => 'Include group', str_contains($typeKey, 'alllicensedusersassignmenttarget') => 'All Users', str_contains($typeKey, '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; $filterTypeRaw = strtolower((string) ($target['deviceAndAppManagementAssignmentFilterType'] ?? 'none')); $filterType = $filterTypeRaw !== '' ? $filterTypeRaw : 'none'; $filterName = $target['assignment_filter_name'] ?? null; $filterLabel = $filterName ?? $filterId; @endphp
{{ $typeName }} @if($groupId) : @if($groupOrphaned) ⚠️ Unknown group (ID: {{ $groupId }}) @elseif($groupName) {{ $groupName }} ({{ $groupId }}) @else Group ID: {{ $groupId }} @endif @endif @if($filterLabel) Filter{{ $filterType !== 'none' ? " ({$filterType})" : '' }}: {{ $filterLabel }} @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