@php $scopeTags = $version->scope_tags['names'] ?? []; @endphp @if(!empty($scopeTags))
@foreach($scopeTags as $tag) {{ $tag }} @endforeach
@endif @if($version->assignments && count($version->assignments) > 0)

Summary

{{ count($version->assignments) }} assignment(s) @php $hasOrphaned = $version->metadata['has_orphaned_assignments'] ?? false; @endphp @if($hasOrphaned) (includes orphaned groups) @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) @php $groupLabel = $groupLabels[$groupId] ?? \App\Services\Directory\EntraGroupLabelResolver::formatLabel( is_string($groupName) ? $groupName : null, (string) $groupId, ); @endphp : @if($groupOrphaned) ⚠️ {{ $groupLabel }} @elseif($groupLabel) {{ $groupLabel }} @else {{ $groupId }} @endif @endif @if($filterLabel) Filter{{ $filterType !== 'none' ? " ({$filterType})" : '' }}: {{ $filterLabel }} @endif ({{ $intent }})
@endforeach
@else @php $assignmentsFetched = $version->metadata['assignments_fetched'] ?? false; $assignmentsFetchFailed = $version->metadata['assignments_fetch_failed'] ?? false; $assignmentsFetchError = $version->metadata['assignments_fetch_error'] ?? null; @endphp @if($assignmentsFetchFailed)

Assignments could not be fetched from Microsoft Graph.

@if($assignmentsFetchError)

{{ $assignmentsFetchError }}

@endif @elseif($assignmentsFetched)

No assignments found for this version.

@else

Assignments were not captured for this version.

@endif @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 @php $complianceTotal = $compliance['total'] ?? 0; $complianceTemplates = $compliance['templates'] ?? []; @endphp @if($complianceTotal > 0)
@foreach($compliance['items'] ?? [] as $item) @php $ruleName = $item['rule_name'] ?? null; $templateId = $item['template_id'] ?? null; @endphp
{{ $ruleName ?: 'Default rule' }} @if($templateId) Template: {{ $templateId }} @endif
@endforeach
@endif