@php /** * Unified cuisine card — one consistent style across the home "Browse by cuisine" * carousel, the /cuisines page and the find-location page. The centre circle shows * the country flag (or the admin's chosen icon); the cuisine's associated dishes * appear as small 3D icons in the card corners. * * @var array $cuisine cuisine row (id, name, slug, icon, restaurant_count) * @var array $dishes up to 4 representative dish tags [['slug','name','icon'], ...] * @var string $blurb optional one-line description (shown on the /cuisines grid) * @var string $variant 'carousel' | 'grid' (sizing/blurb) */ $variant = $variant ?? 'carousel'; $blurb = $blurb ?? ''; $dishes = array_slice($dishes ?? [], 0, 4); $corners = ['tl', 'tr', 'bl', 'br']; $cnt = (int) ($cuisine['restaurant_count'] ?? 0); // Polished 3D icons (one webp per dish slug). The corners are decoration, so a dish // without an icon omits its corner 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 @if ($dishes) @endif {!! cuisine_icon_html((string) $cuisine['slug'], $cuisine['icon'] ?? null, 'qm-cuisine-card-flag-img') !!} {{ $cuisine['name'] }} @if ($blurb !== ''){{ $blurb }}@endif @if ($cnt > 0) {{ t_raw($cnt === 1 ? 'common.places_one' : 'common.places_many', [':n' => $cnt]) }} @else {{ t_raw('common.coming_soon') }} @endif