@extends('frontend.layouts.app') @php // SEO foundation (spec §15): title + meta description (seo fields → fallback place data) $metaDescription = $place->seo_description ?: \Illuminate\Support\Str::limit( strip_tags((string) ($place->description ?: $place->content ?: '')), 160, '…' ); // ---- Hero: background = featured_image (fallback: cover image) ---- $heroImage = $place->featured_image ?: $place->image; $heroImage = $heroImage ? (Str::startsWith($heroImage, ['http://', 'https://']) ? $heroImage : asset($heroImage)) : null; // ---- Quick Facts card (reference) — only filled fields (§12 no-placeholder rule) ---- $quickFacts = array_filter([ 'State' => $place->state, 'District' => $place->district, 'Best Time' => $information?->best_time ? \Illuminate\Support\Str::limit(trim(strip_tags($information->best_time)), 60, '…') : null, 'Famous For' => $place->famous_for, ], fn ($v) => $v !== null && trim((string) $v) !== ''); // ---- Location + basic info rows (existing cards) ---- $locationRows = array_filter([ 'City' => $place->city, 'Country' => $place->country, 'Pincode' => $place->pincode, 'Coordinates' => ($place->latitude !== null && $place->longitude !== null) ? ((float) $place->latitude) . ', ' . ((float) $place->longitude) : null, ], fn ($v) => $v !== null && $v !== ''); $basicRows = array_filter([ 'Place Type' => $place->category?->name, 'Phone' => $place->phone, 'Email' => $place->email, 'Website' => $place->website, 'Address' => $place->address, ], fn ($v) => $v !== null && $v !== ''); // ---- About / History kept SEPARATE (reference: 2-column block, right after the hero) ---- // The remaining content sections stay section-driven (§17 order). $contentByKey = []; foreach ($sections as $s) { if (($s['kind'] ?? '') === 'content') { $contentByKey[$s['key']] = $s['html']; } } $aboutHtml = $contentByKey['about'] ?? null; $historyHtml = $contentByKey['history'] ?? null; $restSections = array_values(array_filter( $sections, fn ($s) => ! in_array($s['key'] ?? '', ['about', 'history'], true) )); // ---- Render plan: content = full width, entity = 2-col grid (reference pairing) ---- $groups = []; $gridBuffer = []; foreach ($restSections as $s) { if (($s['kind'] ?? '') === 'content') { if ($gridBuffer !== []) { $groups[] = ['kind' => 'grid', 'items' => $gridBuffer]; $gridBuffer = []; } $groups[] = ['kind' => 'full', 'sec' => $s]; } else { $gridBuffer[] = $s; } } if ($gridBuffer !== []) { $groups[] = ['kind' => 'grid', 'items' => $gridBuffer]; } // ---- Quick category strip (anchor nav) — only the sections actually being rendered ---- $contentIcons = [ 'about' => 'fa-solid fa-book-open', 'history' => 'fa-solid fa-landmark', 'culture' => 'fa-solid fa-masks-theater', 'heritage' => 'fa-solid fa-monument', 'importance' => 'fa-solid fa-hands-praying', 'geography' => 'fa-solid fa-earth-asia', 'how_to_reach' => 'fa-solid fa-route', 'best_time' => 'fa-solid fa-calendar-check', 'travel_tips' => 'fa-solid fa-suitcase-rolling', 'faqs' => 'fa-solid fa-circle-question', 'yatri_information' => 'fa-solid fa-compass', 'important_information'=> 'fa-solid fa-circle-info', ]; $quickLinks = []; if ($aboutHtml) { $quickLinks[] = ['label' => 'About', 'icon' => 'fa-solid fa-book-open', 'href' => '#about']; } if ($historyHtml) { $quickLinks[] = ['label' => 'History', 'icon' => 'fa-solid fa-landmark', 'href' => '#history']; } foreach ($restSections as $s) { if ($s['kind'] === 'entities') { $quickLinks[] = [ 'label' => $s['meta']['label'], 'icon' => $s['meta']['icon'], 'href' => '#sec-' . $s['key'], ]; } else { $quickLinks[] = [ 'label' => $s['label'], 'icon' => $contentIcons[$s['key']] ?? 'fa-solid fa-file-lines', 'href' => '#sec-' . $s['key'], ]; } } // ---- CTAs ---- $videoUrl = $place->video_url; // Plan Your Visit → first available travel section (if any) $planVisitHref = null; foreach (['how_to_reach', 'yatri_information', 'best_time', 'important_information'] as $k) { if (isset($contentByKey[$k])) { $planVisitHref = '#sec-' . $k; break; } } $mapHref = ($place->latitude !== null && $place->longitude !== null) ? 'https://maps.google.com/?q=' . (float) $place->latitude . ',' . (float) $place->longitude : null; // Entity type for Must Visit cards → URL path $entityPath = fn (string $type) => config('place_entities.types.' . $type . '.path'); @endphp @section('title', $place->seo_title ?: $place->name . ' - Explore Braj') @section('meta_description', e($metaDescription)) @section('og_title', $place->seo_title ?: $place->name . ' | The Braj') @section('og_description', e($metaDescription)) @if($place->canonical_url) @section('canonical', $place->canonical_url) @endif @if($place->og_image) @section('og_image', Str::startsWith($place->og_image, ['http://', 'https://']) ? $place->og_image : asset($place->og_image)) @endif @section('content') {{-- Admin PREVIEW banner (spec §3E) — team-only view of a draft/archived place --}} @if(! empty($preview))
PREVIEW MODE — {{ $place->status === 'published' ? 'Published' : ucfirst($place->status) }} place, visible only to your team. Edit
@endif
{{-- ================= HERO (reference structure) ================= --}}
@if($heroImage) {{ $place->seo_image_alt ?: $place->name }} @endif
{{-- Breadcrumb (spec §15) --}}
@include('frontend.shared._report', ['type' => 'place', 'id' => $place->id])
{{-- Title + 🔊 audio pronunciation (browser TTS — free, no upload) --}}

{{ $place->name }}

{{-- Place Name (Hindi) — spec §4A/§5-3 --}} @if($place->name_hi)

{{ $place->name_hi }}

@endif @if($place->tagline)

{{ $place->tagline }}

@endif @if($place->description)

{{ $place->description }}

@endif {{-- CTAs: Watch Video / Plan Your Visit / View Map — only the available ones --}}
@if($videoUrl) @endif @if($planVisitHref) Plan Your Visit @endif @if($mapHref) View Map @endif
{{-- Quick Facts card (reference) — only filled rows --}} @if($quickFacts) @endif
{{-- ================= QUICK CATEGORY STRIP (anchor nav) ================= --}} @if(count($quickLinks) > 1) @endif
{{-- ============ ABOUT + HISTORY (2-column, reference) ============ --}} @if($aboutHtml || $historyHtml)
@if($aboutHtml)

About {{ $place->name }}

{!! $aboutHtml !!}
@if(\Illuminate\Support\Str::length(strip_tags($aboutHtml)) > 420) @endif
@endif @if($historyHtml)

History & Heritage

{!! $historyHtml !!}
@if(\Illuminate\Support\Str::length(strip_tags($historyHtml)) > 420) @endif
@endif
@endif {{-- ============ MUST VISIT PLACES (horizontal strip) ============ --}} @if($mustVisit->count())

Must Visit Places in {{ $place->name }}

@php $firstEntityType = $mustVisit->first()->type; $allSameType = $mustVisit->pluck('type')->unique()->count() === 1; @endphp @if($allSameType && $entityPath($firstEntityType)) View All @endif
@endif {{-- ============ SECTION BLOCKS ============ --}} @foreach($groups as $group) @if($group['kind'] === 'full') @php $sec = $group['sec']; @endphp

{{ $sec['label'] }}

{!! $sec['html'] !!}
@else
@foreach($group['items'] as $sec) @if($sec['kind'] === 'entities') {{-- entity section: Temples / Ghats / Kunds / Vans / Important Places --}}

{{ $sec['meta']['label'] }} ({{ $sec['total'] }})

View All
@endif @endforeach
@endif @endforeach {{-- ============ LOCAL BUSINESSES (Directory integration — this place's published listings) ============ --}} @if(($placeBusinesses ?? collect())->isNotEmpty())

Local Businesses & Services

View All
@endif {{-- ============ LOCATION + BASIC INFO (small info cards) ============ --}} @if($locationRows || $basicRows || $place->opening_time || $place->closing_time)

Visitor Information

@if($locationRows)

Location

@foreach($locationRows as $label => $value)
{{ $label }} {{ $value }}
@endforeach
@endif @if($basicRows)

Basic Information

@foreach($basicRows as $label => $value)
{{ $label }} {{ $value }}
@endforeach
@endif @if($place->opening_time || $place->closing_time)

Timings

Darshan / Visit {{ $place->opening_time ?? '—' }} - {{ $place->closing_time ?? '—' }}
@endif
@endif {{-- ============ PHOTO GALLERY (spec §5-12 — the EXISTING media library) ============ --}} @if($place->galleryMedia->isNotEmpty()) @endif {{-- ============ EMERGENCY CONTACTS (verified only; place + national) ============ --}} @if(($emergencyContacts ?? collect())->isNotEmpty() || ($nationalHelplines ?? collect())->isNotEmpty())

Emergency Contacts

@foreach($emergencyContacts as $ec)
{{ $ec->name }}
{{ \App\Models\EmergencyContact::categoryLabel($ec->category) }} · {{ $place->name }}
Call {{ $ec->phone }}
@endforeach @foreach($nationalHelplines as $ec)
{{ $ec->name }}
{{ \App\Models\EmergencyContact::categoryLabel($ec->category) }} · National Helpline
Call {{ $ec->phone }}
@endforeach

Verified contacts only. In a serious emergency always dial 112 first.

@endif {{-- ============ RELEVANT STORIES (spec §5-14 — existing stories module) ============ --}} @if($placeStories->isNotEmpty())

Stories from {{ $place->name }}

All Stories
@endif {{-- ============ DEVOTEE BLOGGER & AUTHOR ARTICLES ============ --}} @if(($placeArticles ?? collect())->isNotEmpty())

✍️ {{ __('Devotee Articles & Sacred Kathas') }}

{{ $place->name }} के संदर्भ में संतों व भक्तों द्वारा रचित पावन आलेख एवं दर्शन अनुभव।

✍️ {{ __('Write an Article') }} {{ __('All Authors') }}
@endif @if(($placeEvents ?? collect())->isNotEmpty())

Upcoming Events in {{ $place->name }}

All Events
@endif {{-- ============ RELATED SEVA CTA (spec §5-15) ============ --}}

Serve {{ $place->name }}

Your seva keeps the living traditions of Braj alive. Support a campaign through The Braj Dham Seva Trust.

Explore Seva Gau Seva
{{-- ============ RELATED / NEARBY PLACES ============ --}} @if($relatedPlaces->count() > 0) @endif
{{-- ================= VIDEO MODAL ================= --}} @if($videoUrl) @endif @push('scripts') @endpush @endsection