@php // Switched off in Admin -> Pages: the hero does not draw. if (!section_on('hero-cuisine')) { return; } /** * Cuisine-page hero — a slider that spotlights the top cuisines (one slide each): a flag-forward * copy panel beside a big food image. Reuses the .qm-heroslider shell so home.js drives the * fade/dots/arrows with no JS change; the slide internals are this page's own design. * @var array $cuisineBlocks [ ['cuisine'=>..,'dishes'=>..,'shops'=>..], ... ] */ $blocks = array_slice($cuisineBlocks ?? [], 0, 4); if (!$blocks) { return; } $n = count($blocks); // Polished 3D icons (one webp per dish slug). The dish row is decoration, so a dish // without an icon omits its tile rather than requesting a file that is not there. $has3d = []; foreach (glob(public_path() . '/assets/client/icons3d/*.png') ?: [] as $p) { $has3d[basename($p, '.png')] = true; } @endphp
@foreach ($blocks as $i => $b) @php $cz = $b['cuisine']; $img = media($b['shops'][0]['cover_image'] ?? null, 'assets/client/covers/shop-1.png'); $flag = cuisine_flag((string) ($cz['slug'] ?? '')); $cnt = (int) ($cz['restaurant_count'] ?? 0); $dishes = array_slice($b['dishes'] ?? [], 0, 4); @endphp @endforeach
@for ($d = 0; $d < $n; $d++) @endfor