@php $deploymentStatusMeta = function (string $status): array { $label = match ($status) { 'finished' => 'Success', 'in_progress' => 'In progress', 'cancelled-by-user' => 'Cancelled', 'queued' => 'Queued', 'failed' => 'Failed', default => str($status)->headline()->toString(), }; $type = match ($status) { 'finished' => 'success', 'in_progress', 'queued' => 'warning', 'failed' => 'error', default => 'neutral', }; return [$label, $type]; }; $hasActiveDeployments = $activeDeployments->isNotEmpty(); $hasRecentDeployments = $recentDeployments->isNotEmpty(); $hasAnyDeployments = $hasActiveDeployments || $hasRecentDeployments; @endphp
$hasAnyDeployments])> @if ($hasAnyDeployments)

Deployments

Active and recent deployment activity

@if ($hasActiveDeployments)

Active

Running or queued right now

@foreach ($activeDeployments as $deployment) @php [$deploymentStatus, $deploymentStatusType] = $deploymentStatusMeta($deployment->status); $projectName = $deployment->application?->environment?->project?->name; $environmentName = $deployment->application?->environment?->name; $environmentPath = collect([$projectName, $environmentName])->filter()->join(' / '); @endphp

{{ $deployment->application_name }}

@if ($deployment->pull_request_id)

Pull request #{{ $deployment->pull_request_id }}

@endif

{{ $environmentPath ?: '-' }} · {{ $deployment->server_name ?: '-' }}

@endforeach
@endif @if ($hasRecentDeployments)

Recent

Latest completed deployments

@foreach ($recentDeployments as $deployment) @php [$deploymentStatus, $deploymentStatusType] = $deploymentStatusMeta($deployment->status); $projectName = $deployment->application?->environment?->project?->name; $environmentName = $deployment->application?->environment?->name; $environmentPath = collect([$projectName, $environmentName])->filter()->join(' / '); @endphp

{{ $deployment->application_name }}

@if ($deployment->pull_request_id)

Pull request #{{ $deployment->pull_request_id }}

@endif

{{ $environmentPath ?: '-' }} · {{ $deployment->server_name ?: '-' }}

@endforeach
@endif
@endif