@php $isSuggested = (bool) ($row['is_suggested'] ?? false); $dnsType = match ($row['dns_status']) { 'ok' => 'success', 'failed' => 'error', 'skipped' => 'warning', default => 'neutral', }; $dnsLabel = match ($row['dns_status']) { 'ok' => 'DNS OK', 'failed' => 'DNS mismatch', 'skipped' => 'DNS skipped', 'pending' => 'DNS pending', default => 'DNS unknown', }; $gridClass = $domainGridClass ?? (($isCompose ?? false) ? 'domains-table-grid-compose' : 'domains-table-grid'); $domainParts = $isSuggested ? null : parse_url($row['url']); $faviconUrl = is_array($domainParts) && isset($domainParts['scheme'], $domainParts['host']) ? $domainParts['scheme'].'://'.$domainParts['host'].(isset($domainParts['port']) ? ':'.$domainParts['port'] : '').'/favicon.ico' : null; $redirectPairKey = function (string $url): string { $parts = parse_url($url); if (! is_array($parts) || ! isset($parts['host'])) { return $url; } $host = preg_replace('/^www\./i', '', $parts['host']); return strtolower(($parts['scheme'] ?? '').'://'.$host.':'.($parts['port'] ?? '').($parts['path'] ?? '')); }; $pairKey = $redirectPairKey($row['url']); $firstPairRowIndex = collect($domainRows) ->reject(fn ($item) => (bool) ($item['is_suggested'] ?? false)) ->filter(fn ($item) => ($item['service'] ?? null) === ($row['service'] ?? null)) ->filter(fn ($item) => $redirectPairKey($item['url']) === $pairKey) ->keys() ->first(); $showDirection = ($showDirectionControl ?? true) && ! $isSuggested && $firstPairRowIndex === $index; @endphp
$isSuggested, 'domains-row-without-direction' => ! $showDirection, ])>
@if ($isSuggested) {{ $row['url'] }} @else @if ($faviconUrl) @endif {{ $row['url'] }} @endif @if ($isSuggested && ! empty($row['suggestion_label'])) {{ $row['suggestion_label'] }} @endif @if ($isCompose ?? false) {{ $row['service'] ?? '-' }} @endif
@if ($isSuggested && filled($row['dns_message']))

{{ $row['dns_message'] }}

@endif
@if ($isCompose ?? false)
{{ $row['service'] ?? '-' }}
@endif
@if ($row['dns_status'] === 'failed') @else @endif
@unless ($isSuggested) Search engine indexing @endunless @if ($isSuggested) - @elseif (auth()->user()?->can('update', $application) && ! $labelsAreWritable) @else {{ $application->isDomainNoindexed($row['url']) ? 'Noindex' : 'Indexable' }} @endif
@if ($showDirectionControl ?? true)
@php $rowDirection = $domainDirection ?? $redirect; $directionLabel = match ($rowDirection) { 'www' => 'Redirect to www', 'non-www' => 'Redirect to non-www', default => 'Allow both', }; @endphp @if ($showDirection) Direction @endif @if ($showDirection && auth()->user()?->can('update', $application) && ! $labelsAreWritable) @elseif ($showDirection) {{ $directionLabel }} @endif
@endif
@can('update', $application) @unless ($labelsAreWritable) @if ($isSuggested) @if ($row['needs_force_add'] ?? false) Continue @else Add domain @endif @else @endif @endunless @endcan