@forelse ($images as $image)
@php
$tag = data_get($image, 'tag');
$date = data_get($image, 'created_at');
$createdAt = \Illuminate\Support\Carbon::parse($date);
$isCommitSha = preg_match('/^[0-9a-f]{7,128}$/i', $tag);
$isPrTag = preg_match('/^pr-\d+$/', $tag);
$isRollbackable = $isCommitSha || $isPrTag;
$isCurrent = data_get($image, 'is_current');
@endphp
{{ $tag }}
@if ($isCurrent)
@elseif (!$isRollbackable)
@endif
Built {{ $createdAt->diffForHumans() }}
·
{{ $date }}
@can('deploy', $application)
@if ($isCurrent)
Rollback
@elseif (!$isRollbackable)
Rollback
@else
Roll back to this image
@endif
@endcan
@empty
@endforelse