@php
$configuredCount = collect($domainRows)->where('is_suggested', false)->count();
$suggestedCount = collect($domainRows)->where('is_suggested', true)->count();
$hasRows = count($domainRows) > 0;
$hasDnsChecksInProgress = collect($domainRows)->contains(fn ($row) => $row['dns_status'] === 'checking');
$composeDomainGroups = collect($domainRows)
->groupBy(fn ($row) => $row['service'] ?? '__unknown')
->filter(fn ($rows) => $rows->contains(fn ($row) => ! ($row['is_suggested'] ?? false)));
$hasHttpsDomains = collect($domainRows)->contains(
fn ($row) => ! ($row['is_suggested'] ?? false) && str_starts_with(strtolower($row['url']), 'https://')
);
@endphp
@if ($hasDnsChecksInProgress)
@endif
@if ($labelsAreWritable)
Container label readonly mode is disabled. Domains must be set in the Labels section on the General page.
@endif
@if ($isCompose && count($composeServices) === 0)
No non-database services found in the Docker Compose file. Domains can only be assigned to application
services.
@endif
@cannot('update', $application)
You don't have permission to manage domains. Contact your team administrator for access.
@endcannot
{{-- Toolbar --}}
Domains
{{ $configuredCount }} domain{{ $configuredCount === 1 ? '' : 's' }}
@if ($suggestedCount > 0)
ยท {{ $suggestedCount }} not added
@endif
@if ($hasRows)
@endif
@can('update', $application)
Check all DNS
@include('livewire.project.shared.cloudflare-autoconfigure')
@unless ($labelsAreWritable)
@if (! $isCompose || count($composeServices) > 0)
Add domain
@endif
@endunless
@endcan
@if ($hasHttpsDomains && ! $labelsAreWritable)
@endif
{{-- Table / empty --}}
@if ($hasRows)
Domain
Protocol redirect
Domain redirect
Internal port
Search indexing
DNS status
Actions
@endif
@if ($isCompose && count($composeServices) === 0 && ! $hasRows)
@elseif ($isCompose && $composeDomainGroups->isEmpty())
@elseif (! $hasRows)
@elseif ($isCompose)
@php
$grouped = $composeDomainGroups;
$serviceOrder = collect($composeServices)
->filter(fn ($serviceName) => $grouped->has($serviceName))
->values()
->all();
foreach ($grouped->keys() as $name) {
if ($name !== '__unknown' && ! in_array($name, $serviceOrder, true)) {
$serviceOrder[] = $name;
}
}
$domainSearchValues = collect($serviceOrder)
->map(fn ($serviceName) => $serviceName.' '.$grouped->get($serviceName, collect())->pluck('url')->implode(' '))
->values();
@endphp
@foreach ($serviceOrder as $serviceName)
@php
$rows = $grouped->get($serviceName, collect());
$redirectWireKey = $this->serviceRedirectWireKey($serviceName);
@endphp
{{ $serviceName }}
@foreach ($rows as $row)
@php
$index = collect($domainRows)->search(
fn ($item) => $item['url'] === $row['url']
&& ($item['service'] ?? null) === ($row['service'] ?? null)
&& (bool) ($item['is_suggested'] ?? false) === (bool) ($row['is_suggested'] ?? false),
);
@endphp
@include('livewire.project.application.partials.domain-row', [
'index' => $index,
'row' => $row,
'application' => $application,
'labelsAreWritable' => $labelsAreWritable,
'isCompose' => true,
])
@endforeach
@endforeach
@else
@foreach ($domainRows as $index => $row)
@include('livewire.project.application.partials.domain-row', [
'index' => $index,
'row' => $row,
'application' => $application,
'labelsAreWritable' => $labelsAreWritable,
'isCompose' => false,
])
@endforeach
@endif
{{-- One dialog for address edits and automatically saved domain settings. --}}
@if ($showPortWarningModal)
@endif