@php // Switched off in Admin -> Pages: the band does not draw, on any layout that includes it. if (!section_on('trending')) { return; } /** * "Trending this week" — now delegates to the shared card-rail (single source for the * rail markup + autoplay), so any tweak to the rail/cards propagates across every page. * * @var array $items Restaurant rows (e.g. Restaurant->trending(8)) */ $items = collect($items ?? [])->all(); // accepts an array or a collection if (empty($items)) { echo partial('sections/band-empty', ['eyebrow' => t('home.trending.eyebrow'), 'title' => t('home.trending.title'), 'icon' => 'fa-fire', 'msg' => t('home.empty_restaurants')]); return; } // Note: card-rail re-escapes title/eyebrow/sub with e() - safe here only because // none of these translated strings contain HTML-special characters in any // enabled language. Revisit if that ever changes. echo partial('sections/card-rail', [ 'items' => $items, 'card' => 'cards/restaurant', 'cardKey' => 'r', 'title' => t('home.trending.title'), 'eyebrow' => t('home.trending.eyebrow'), 'eyebrowIcon' => 'fa-fire', 'sub' => t('home.trending.sub'), 'viewAllUrl' => route('restaurants', ['sort' => 'rating']), 'autoplay' => true, 'compact' => true, ]); @endphp