@php $fieldWrapperView = $getFieldWrapperView(); $results = $getState() ?? []; $results = is_array($results) ? $results : []; $summary = $summary ?? []; $summary = is_array($summary) ? $summary : []; $checksIntegrity = $checksIntegrity ?? []; $checksIntegrity = is_array($checksIntegrity) ? $checksIntegrity : []; $executionReadiness = $executionReadiness ?? []; $executionReadiness = is_array($executionReadiness) ? $executionReadiness : []; $safetyAssessment = $safetyAssessment ?? []; $safetyAssessment = is_array($safetyAssessment) ? $safetyAssessment : []; $blocking = (int) ($summary['blocking'] ?? ($checksIntegrity['blocking_count'] ?? 0)); $warning = (int) ($summary['warning'] ?? ($checksIntegrity['warning_count'] ?? 0)); $safe = (int) ($summary['safe'] ?? 0); $ranAt = $ranAt ?? ($checksIntegrity['ran_at'] ?? null); $ranAtLabel = null; if (is_string($ranAt) && $ranAt !== '') { try { $ranAtLabel = \Carbon\CarbonImmutable::parse($ranAt)->format('Y-m-d H:i'); } catch (\Throwable) { $ranAtLabel = $ranAt; } } $severitySpec = static function (?string $severity): \App\Support\Badges\BadgeSpec { return \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::RestoreCheckSeverity, $severity); }; $integritySpec = $severitySpec($checksIntegrity['state'] ?? 'not_run'); $integritySummary = $checksIntegrity['display_summary'] ?? 'Run checks for the current scope before real execution.'; $nextAction = $safetyAssessment['primary_next_action'] ?? 'rerun_checks'; $nextActionLabel = \App\Support\RestoreSafety\RestoreSafetyCopy::primaryNextAction(is_string($nextAction) ? $nextAction : 'rerun_checks'); $startabilitySummary = $executionReadiness['display_summary'] ?? 'Execution readiness is unavailable.'; $startabilityTone = (bool) ($executionReadiness['allowed'] ?? false) ? 'success' : 'warning'; $limitedList = static function (array $items, int $limit = 5): array { if (count($items) <= $limit) { return $items; } return array_slice($items, 0, $limit); }; @endphp
{{ $integritySpec->label }} {{ (bool) ($executionReadiness['allowed'] ?? false) ? 'Technically startable' : 'Technical blocker present' }} @if (($safetyAssessment['state'] ?? null) === 'ready_with_caution') Ready with caution @elseif (($safetyAssessment['state'] ?? null) === 'ready') Ready @endif
What the current checks prove
{{ $integritySummary }}
Technical startability: {{ $startabilitySummary }}
Primary next step
{{ $nextActionLabel }}
{{ $blocking }} {{ \Illuminate\Support\Str::lower($severitySpec('blocking')->label) }} {{ $warning }} {{ \Illuminate\Support\Str::lower($severitySpec('warning')->label) }} {{ $safe }} {{ \Illuminate\Support\Str::lower($severitySpec('safe')->label) }}
@if (($checksIntegrity['invalidation_reasons'] ?? []) !== [])
Invalidated by: {{ implode(', ', array_map(static fn (string $reason): string => \Illuminate\Support\Str::replace('_', ' ', $reason), $checksIntegrity['invalidation_reasons'])) }}
@endif
@if ($results === [])
No checks have been recorded for this scope yet.
@else
@foreach ($results as $result) @php $severity = is_array($result) ? ($result['severity'] ?? 'safe') : 'safe'; $title = is_array($result) ? ($result['title'] ?? $result['code'] ?? 'Check') : 'Check'; $message = is_array($result) ? ($result['message'] ?? null) : null; $meta = is_array($result) ? ($result['meta'] ?? []) : []; $meta = is_array($meta) ? $meta : []; $unmappedGroups = $meta['unmapped'] ?? []; $unmappedGroups = is_array($unmappedGroups) ? $limitedList($unmappedGroups) : []; $spec = $severitySpec($severity); @endphp
{{ $title }}
@if (is_string($message) && $message !== '')
{{ $message }}
@endif
{{ $spec->label }}
@if ($unmappedGroups !== [])
Unmapped groups
    @foreach ($unmappedGroups as $group) @php $label = is_array($group) ? ($group['label'] ?? $group['id'] ?? null) : null; @endphp @if (is_string($label) && $label !== '')
  • {{ $label }}
  • @endif @endforeach
@endif
@endforeach
@endif