@php use Illuminate\Support\Str; /** @var array $bundle */ $summary = is_array($bundle['summary'] ?? null) ? $bundle['summary'] : []; $context = is_array($bundle['context'] ?? null) ? $bundle['context'] : []; $sections = is_array($bundle['sections'] ?? null) ? $bundle['sections'] : []; $redaction = is_array($bundle['redaction'] ?? null) ? $bundle['redaction'] : []; $notes = is_array($bundle['notes'] ?? null) ? $bundle['notes'] : []; $recommendedFirstCheck = is_array(data_get($summary, 'recommended_first_check')) ? data_get($summary, 'recommended_first_check') : null; $contextNotes = collect($notes) ->filter(static fn (mixed $note): bool => is_string($note) && trim($note) !== '') ->reject(static fn (string $note): bool => str_contains($note, 'redacted support view')) ->values() ->all(); $availabilityLabel = static function (?string $availability): string { return match ($availability) { 'available' => 'Available', 'current' => 'Current', 'fresh' => 'Fresh', 'ready' => 'Ready', 'partial' => 'Partial', 'stale' => 'Stale', 'error' => 'Error', 'missing' => 'Not observed', 'unavailable' => 'Unavailable', 'redacted' => 'Redacted', default => filled($availability) ? Str::headline(str_replace('_', ' ', (string) $availability)) : 'Unknown', }; }; $availabilityColor = static function (?string $availability): string { return match ($availability) { 'available', 'current', 'fresh', 'ready' => 'success', 'partial', 'stale' => 'warning', 'error', 'missing', 'unavailable' => 'danger', default => 'gray', }; }; $contextTypeLabel = static function (?string $type): string { return match ($type) { 'operation_run' => 'Operation context', 'tenant' => 'Environment context', default => filled($type) ? Str::headline(str_replace('_', ' ', (string) $type)) : 'Environment context', }; }; $freshnessStateLabel = static function (?string $state): string { return match ($state) { 'fresh' => 'Fresh', 'mixed' => 'Mixed freshness', 'missing_context' => 'Missing context', default => filled($state) ? Str::headline(str_replace('_', ' ', (string) $state)) : 'Unknown freshness', }; }; $redactionModeLabel = static function (?string $mode): string { return match ($mode) { 'default_redacted', 'default-redacted' => 'Redacted support view', default => filled($mode) ? Str::headline(str_replace('_', ' ', (string) $mode)) : 'Redacted support view', }; }; $referenceTypeLabel = static function (?string $type): string { return match ($type) { 'audit_log' => 'Audit event', 'environment_review' => 'Environment review', 'finding' => 'Finding', 'operation_run' => 'Operation', 'provider_connection' => 'Provider connection', 'review_pack' => 'Review pack', 'stored_report' => 'Stored report', 'tenant' => 'Environment', default => filled($type) ? Str::headline(str_replace('_', ' ', (string) $type)) : 'Reference', }; }; $referenceDescription = static function (array $reference) use ($availabilityLabel, $referenceTypeLabel): string { $parts = [ $referenceTypeLabel(is_string($reference['type'] ?? null) ? (string) $reference['type'] : null), $availabilityLabel(is_string($reference['availability'] ?? null) ? (string) $reference['availability'] : 'missing'), ]; if (is_string($reference['freshness_note'] ?? null) && trim((string) $reference['freshness_note']) !== '') { $parts[] = (string) $reference['freshness_note']; } return implode(' - ', $parts); }; $sectionObserved = static function (array $section, array $references): string { if (is_string($section['freshness_note'] ?? null) && trim((string) $section['freshness_note']) !== '') { return (string) $section['freshness_note']; } $availableCount = collect($references) ->filter(static fn (array $reference): bool => ($reference['availability'] ?? null) === 'available') ->count(); if ($availableCount > 0) { return $availableCount === 1 ? '1 related reference observed.' : $availableCount.' related references observed.'; } return 'No related record observed in this support context.'; }; @endphp
{{ $contextTypeLabel(data_get($context, 'type', data_get($bundle, 'context_type', 'tenant'))) }} {{ $freshnessStateLabel(data_get($summary, 'freshness_state', data_get($bundle, 'freshness_state', 'mixed'))) }} {{ $redactionModeLabel(data_get($redaction, 'mode', data_get($bundle, 'redaction_mode', 'default_redacted'))) }}

Use this quick support context to start with the recommended first check before opening lower technical sections.

@if ($recommendedFirstCheck !== null) @php $firstCheckReference = is_array($recommendedFirstCheck['reference'] ?? null) ? $recommendedFirstCheck['reference'] : null; $firstCheckReferenceLabel = $firstCheckReference['label'] ?? 'Reference unavailable'; $firstCheckReferenceUrl = is_string($firstCheckReference['url'] ?? null) && trim((string) $firstCheckReference['url']) !== '' ? (string) $firstCheckReference['url'] : null; $firstCheckReferenceActionLabel = $firstCheckReference['action_label'] ?? ($firstCheckReferenceUrl ? 'Open' : 'Unavailable'); @endphp

Recommended first check

{{ data_get($recommendedFirstCheck, 'body', 'Start with the highest-confidence support reference before inspecting lower sections.') }}

{{ data_get($recommendedFirstCheck, 'label', 'Review source first') }}
@if ($firstCheckReference !== null)
{{ $firstCheckReferenceLabel }} @if ($firstCheckReferenceUrl) {{ $firstCheckReferenceActionLabel }} @else {{ $firstCheckReferenceActionLabel }} @endif
@endif
@endif
Workspace
{{ data_get($context, 'workspace_label', 'Workspace unavailable') }}
Environment
{{ data_get($context, 'tenant_label', 'Environment unavailable') }}
@if (is_array($bundle['contextual_help'] ?? null)) @include('filament.components.product-knowledge.contextual-help', ['help' => $bundle['contextual_help']]) @endif @if ($notes !== [])

Support scope

Read-only, redacted support view. Restricted provider details are excluded.

@if ($contextNotes !== [])
@foreach ($contextNotes as $note) {{ $note }} @endforeach
@endif
@endif
@foreach ($sections as $section) @php $references = is_array($section['references'] ?? null) ? $section['references'] : []; $markers = is_array($section['redaction_markers'] ?? null) ? $section['redaction_markers'] : []; $availability = is_string($section['availability'] ?? null) && trim((string) $section['availability']) !== '' ? (string) $section['availability'] : 'missing'; $sectionLabel = $section['label'] ?? $section['key'] ?? 'Section'; $sectionSummary = $section['summary'] ?? 'No summary available.'; $actionReference = collect($references) ->first(static fn (array $reference): bool => is_string($reference['url'] ?? null) && trim((string) $reference['url']) !== ''); $actionReference = is_array($actionReference) ? $actionReference : (is_array($references[0] ?? null) ? $references[0] : null); $sectionActionUrl = is_array($actionReference) && is_string($actionReference['url'] ?? null) && trim((string) $actionReference['url']) !== '' ? (string) $actionReference['url'] : null; $sectionActionLabel = is_array($actionReference) ? (string) ($actionReference['action_label'] ?? ($sectionActionUrl ? 'Open' : 'No action available')) : 'No action available'; $sectionObservedText = $sectionObserved($section, $references); @endphp {{ $availabilityLabel($availability) }}
Status
{{ $availabilityLabel($availability) }}
Why relevant
{{ $sectionSummary }}
Observed
{{ $sectionObservedText }}
Action
@if ($sectionActionUrl) {{ $sectionActionLabel }} @else {{ $sectionActionLabel }} @endif
@if ($references !== [])
@foreach ($references as $reference) @php $referenceLabel = $reference['label'] ?? 'Reference unavailable'; $referenceUrl = is_string($reference['url'] ?? null) && trim((string) $reference['url']) !== '' ? (string) $reference['url'] : null; $referenceActionLabel = $reference['action_label'] ?? ($referenceUrl ? 'Open' : 'Unavailable'); @endphp

{{ $referenceLabel }}

{{ $referenceDescription($reference) }}

@if ($referenceUrl) {{ $referenceActionLabel }} @else {{ $referenceActionLabel }} @endif
@endforeach
@endif @if ($markers !== [])
@foreach ($markers as $marker) {{ trim((string) (($marker['replacement_text'] ?? '[REDACTED]').' '.Str::of((string) ($marker['reason'] ?? 'redacted'))->replace('_', ' '))) }} @endforeach
@endif
@endforeach