@php $run = $run ?? null; $run = is_array($run) ? $run : null; $runUrl = $runUrl ?? null; $runUrl = is_string($runUrl) && $runUrl !== '' ? $runUrl : null; $status = $run['status'] ?? null; $status = is_string($status) ? $status : null; $outcome = $run['outcome'] ?? null; $outcome = is_string($outcome) ? $outcome : null; $startedAt = $run['started_at'] ?? null; $startedAt = is_string($startedAt) && $startedAt !== '' ? $startedAt : null; $updatedAt = $run['updated_at'] ?? null; $updatedAt = is_string($updatedAt) && $updatedAt !== '' ? $updatedAt : null; $completedAt = $run['completed_at'] ?? null; $completedAt = is_string($completedAt) && $completedAt !== '' ? $completedAt : null; $hasReport = $hasReport ?? false; $hasReport = is_bool($hasReport) ? $hasReport : false; $formatTs = static function (?string $ts): ?string { if ($ts === null) { return null; } try { return \Carbon\CarbonImmutable::parse($ts)->format('Y-m-d H:i'); } catch (\Throwable) { return $ts; } }; $relativeTs = static function (?string $ts): ?string { if ($ts === null) { return null; } try { return \Carbon\CarbonImmutable::parse($ts)->diffForHumans(null, true, true); } catch (\Throwable) { return null; } }; $targetScope = $run['target_scope'] ?? []; $targetScope = is_array($targetScope) ? $targetScope : []; $entraTenantId = $targetScope['entra_tenant_id'] ?? null; $entraTenantId = is_string($entraTenantId) && $entraTenantId !== '' ? $entraTenantId : null; $runStatusSpec = null; if ($status !== null) { $runStatusSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::OperationRunStatus, $status); } $runOutcomeSpec = null; if ($outcome !== null && $status === 'completed') { $runOutcomeSpec = \App\Support\Badges\BadgeRenderer::spec(\App\Support\Badges\BadgeDomain::OperationRunOutcome, $outcome); } $workerHint = match ($status) { 'queued' => 'Awaiting worker', 'running' => 'Worker running', default => null, }; @endphp