@php // Switched off in Admin -> Pages: the band does not draw, on any layout that includes it. if (!section_on('sort-by-foodtype')) { return; } /** * "Browse by food type" strip — REAL typed tags (dish_type + course) with live counts. * Renders the fun 3D icon (Microsoft Fluent Emoji 3D, MIT-licensed) when * assets/client/icons3d/.png exists, else falls back to the tag's FontAwesome glyph. * Store types, diet/protein and cuisines live in their own sections, so the sets never overlap. */ $catTags = (new \App\Models\Tag())->withCounts(); $catTags = $catTags ->filter(static fn ($t): bool => (int) ($t['restaurant_count'] ?? 0) > 0 && in_array($t['group'] ?? '', ['dish_type', 'course'], true)) ->values()->all(); if (empty($catTags)) { return; } $totalRest = \App\Models\Restaurant::query()->where('status', 'approved')->count(); // Scan the 3D icon folder once: slug => has a .png icon. $icon3dDir = public_path() . '/assets/client/icons3d/'; $has3d = []; foreach (glob($icon3dDir . '*.png') ?: [] as $p) { $has3d[basename($p, '.png')] = true; } // Placement: '' = normal flow; 'overlap' = float over the hero's lower edge (cuisine page); // 'overlap-lg' = a deeper pull-up onto the taller restaurant-spotlight hero. $variant = $variant ?? ''; $stripMod = ''; if ($variant === 'overlap') { $stripMod = ' svg-foodtype-strip--overlap'; } elseif ($variant === 'overlap-lg') { $stripMod = ' svg-foodtype-strip--overlap svg-foodtype-strip--overlap-lg'; } @endphp