@php
$h = $hotelModel ?? null;
$translationsByLang = $h?->translations->keyBy('language_id') ?? collect();
$aiGroup = 'hotel-'.($h?->id ?? 'new');
$hotelAiContext = array_filter([
'Nome do hotel' => $h?->name,
'Marca' => $h?->brand?->name,
'Localização' => collect([$h?->destination?->name, $h?->region?->name, $h?->country?->name])->filter()->implode(', ') ?: null,
'Nº de quartos' => $h?->room_count,
'Tipologias de quarto' => $h?->exists ? $h->roomTypes->pluck('name')->filter()->implode(', ') ?: null : null,
'Restaurantes' => $h?->exists ? $h->restaurants->pluck('name')->filter()->implode(', ') ?: null : null,
'Bares' => $h?->exists ? $h->bars->pluck('name')->filter()->implode(', ') ?: null : null,
'Facilities' => ($h?->facilities ?? collect())->pluck('name')->implode(', ') ?: null,
'Spa' => $h?->has_spa ? 'Sim' : null,
'MICE / Eventos' => $h?->has_mice ? 'Sim' : null,
], fn ($v) => $v !== null && $v !== '');
$hotelTabs = [
'geral' => 'Informação Geral',
'descricoes' => 'Descrições',
'facilities' => 'Facilities do Hotel',
'tipologias' => 'Tipologias de Quarto',
'restaurantes' => 'Restaurantes',
'bares' => 'Bares',
'contactos' => 'Contactos',
'alertas' => 'Alertas',
];
@endphp
@foreach ($hotelTabs as $key => $label)
{{ $label }}
@endforeach
Descrições por idioma
@foreach ($languages as $i => $l)
@php $t = $translationsByLang->get($l->id); @endphp
@endforeach
Facilities
Seleciona a partir da lista central. Falta alguma?
Pede ao SuperAdmin para a criar.
@php $selected = old('facilities', $selectedFacilities); @endphp
@foreach ($allFacilities->groupBy(fn ($f) => $f->category ?: 'Outras') as $category => $items)
@endforeach
@if ($allFacilities->isEmpty())
Ainda não existem facilities configuradas. Criar a primeira.
@endif
@foreach ([
'tipologias' => ['label' => 'Tipologias de Quarto', 'route' => 'admin.hotels.room-types.index', 'count' => fn () => $h?->roomTypes->count()],
'restaurantes' => ['label' => 'Restaurantes', 'route' => 'admin.hotels.restaurants.index', 'count' => fn () => $h?->restaurants->count()],
'bares' => ['label' => 'Bares', 'route' => 'admin.hotels.bars.index', 'count' => fn () => $h?->bars->count()],
'contactos' => ['label' => 'Contactos', 'route' => 'admin.hotels.contacts.index', 'count' => fn () => $h?->contacts->count()],
'alertas' => ['label' => 'Alertas', 'route' => 'admin.hotels.alerts.index', 'count' => fn () => $h?->alerts->count()],
] as $key => $section)
@if ($h?->exists)
{{ $section['label'] }} ({{ $section['count']() }})
Gerido como coleção própria, com fotos e descrições multilíngue.
@if (Route::has($section['route']))
Gerir {{ $section['label'] }}
@endif
@else
Grava o hotel primeiro — depois podes gerir {{ $section['label'] }} aqui.
@endif
@endforeach