@php $configuredCount = collect($domainRows)->where('is_suggested', false)->count(); $suggestedCount = collect($domainRows)->where('is_suggested', true)->count(); $hasRows = count($domainRows) > 0; $serviceAppCount = count($serviceApps); $domainGroups = collect($domainRows) ->groupBy('service_application_id') ->filter(fn ($rows) => $rows->contains(fn ($row) => ! ($row['is_suggested'] ?? false))); $domainSearchValues = $domainGroups->map(function ($rows, $appId) use ($serviceApps) { $app = collect($serviceApps)->firstWhere('id', (int) $appId); $heading = \Illuminate\Support\Str::headline($app['name'] ?? $rows->first()['service_name'] ?? 'Service'); return $heading.' '.$rows->pluck('url')->implode(' '); })->values(); @endphp
@can('update', $service) Recheck DNS @endcan @cannot('update', $service) You don't have permission to manage domains. Contact your team administrator for access. @endcannot

Manage domains and www/non-www redirects for applications in this stack.

{{-- Toolbar --}}

{{ $configuredCount }} domain{{ $configuredCount === 1 ? '' : 's' }} @if ($suggestedCount > 0) ยท {{ $suggestedCount }} not added @endif

@if ($domainGroups->isNotEmpty())
@endif @can('update', $service) @if ($serviceAppCount > 0)
@include('livewire.project.shared.cloudflare-autoconfigure')
{{-- Always show which service receives the domain --}} @if ($addDomainDnsFailed) This domain does not currently resolve to this server. Traffic may not reach Coolify until you update DNS. Are you sure you want to add it anyway? @if (filled($addDomainDnsMessage))
{{ $addDomainDnsMessage }}
@endif
@endif
Generate domain
@if ($addDomainDnsFailed) Continue @else Save @endif
@endif @endcan
@if ($serviceAppCount === 0)
@elseif (! $hasRows)
@else
@foreach ($domainGroups as $appId => $rows) @php $app = collect($serviceApps)->firstWhere('id', (int) $appId); $heading = \Illuminate\Support\Str::headline($app['name'] ?? $rows->first()['service_name'] ?? 'Service'); @endphp
{{ $heading }}
@include('livewire.project.service.partials.domain-table', [ 'rows' => $rows, 'domainRows' => $domainRows, 'service' => $service, 'showServiceColumn' => false, 'showHeader' => true, ])
@endforeach
@endif {{-- Edit domain modal: open/close is Alpine-only; server runs only on Save / Continue. --}}