@extends('layouts.public') @section('content') @php /** @var array $cuisines @var array $dishMap @var array $featured @var array $restaurants * @var array $dishes menu items keyed by restaurant id * @var array $windows today's trading window keyed by restaurant id */ $dishes = $dishes ?? []; $windows = $windows ?? []; // Build the map markers — one per approved restaurant that has coordinates. $mapPoints = []; foreach ($restaurants as $r) { $lat = $r['lat'] ?? null; $lng = $r['lng'] ?? null; if ($lat === null || $lng === null || $lat === '' || $lng === '') { continue; } $mapPoints[] = [ 'lat' => (float) $lat, 'lng' => (float) $lng, 'label' => (string) $r['name'], 'url' => url('/restaurant/' . $r['slug']), // The restaurant's own storefront photo as the marker — same framed brandmark // pin the dashboard maps use for the logo, so a diner recognises the place from // the map itself. Falls back to the logo, then initials, when no cover is set. 'iconHtml' => restaurant_cover_html($r, 'sm'), /* WHAT THE PIN SAYS WHEN IT IS OPENED. Built here rather than in the map script so it is translated, formatted and escaped by the same helpers as the rest of the product — a price is money(), a rating is number_format(), and none of that belongs in JavaScript. The map layer simply shows what it is handed. */ 'popupHtml' => partial('map-venue-popup', [ 'r' => $r, 'dishes' => $dishes[(int) $r['id']] ?? [], 'window' => $windows[(int) $r['id']] ?? null, ]), ]; } /* THE DINER'S OWN DOORSTEP, when they are signed in and have saved one. Added last so it draws over the restaurant pins, and it becomes the centre — a page called "Restaurants near you" that opens on somebody else's neighbourhood is answering a different question. A visitor who is not signed in, or has saved nothing, gets exactly what they got before: the first venue. */ $home = $home ?? null; if ($home !== null) { $mapPoints[] = [ 'lat' => (float) $home['lat'], 'lng' => (float) $home['lng'], 'label' => (string) $home['label'], 'glyph' => 'fa-home', ]; } $center = $home !== null ? ['lat' => (float) $home['lat'], 'lng' => (float) $home['lng']] : ($mapPoints[0] ?? ['lat' => 37.7749, 'lng' => -122.4194]); @endphp @if (section_on('geo-explore'))

{{ t_raw('geo.title') }}

@php $placesTotal = (int) ($restaurantsTotal ?? count($restaurants)); @endphp @if ($restaurants){{ t_raw($placesTotal === 1 ? 'common.places_one' : 'common.places_many', [':n' => $placesTotal]) }}@endif
@endif @php // Same rule as the homepage strip: baseline taxonomy ships with the schema, so // only advertise cuisines once at least one actually has a live restaurant. @endphp @php $geoLiveCuisines = collect($cuisines ?? [])->filter(static fn ($c): bool => (int) ($c['restaurant_count'] ?? 0) > 0)->all(); @endphp @if ($cuisines && !$geoLiveCuisines && section_on('geo-cuisines')) @partial('sections/band-empty', ['eyebrow' => t('home.cuisine.eyebrow'), 'title' => t('geo.cuisines_title'), 'icon' => 'fa-globe', 'msg' => t('home.empty_cuisines')]) @endif @if ($geoLiveCuisines && section_on('geo-cuisines'))
@endif @if (section_on('geo-steps'))
{{ t_raw('home.how.eyebrow') }}

{{ t_raw('geo.how_title') }}

{{ t_raw('geo.how_sub') }}

{{ t_raw('geo.how_step1_title') }}

{{ t_raw('geo.how_step1_text') }}

{{ t_raw('geo.how_step2_title') }}

{{ t_raw('geo.how_step2_text') }}

{{ t_raw('geo.how_step3_title') }}

{{ t_raw('geo.how_step3_text') }}

@endif @if ($featured->isNotEmpty() && section_on('geo-featured'))
{{ t_raw('geo.featured_eyebrow') }}

{{ t_raw('geo.featured_title') }}

{{ t_raw('geo.featured_sub') }}

@foreach ($featured as $r)
@partial('cards/restaurant', ['r' => $r])
@endforeach
@endif @endsection