@php $banners = $section->banners; if ($banners->isEmpty() && $section->background_image) { $banners = collect([(object) [ 'name' => $section->name, 'short_description' => $section->short_description, 'banner_image' => $section->background_image, 'button_text' => null, 'link_url' => null, 'web_width' => null, 'image_urls' => null, ]]); } @endphp @foreach ($banners as $banner) @if (($banner->banner_type ?? null) === 'multiple') @include('frontend.components.home-sections.multiple-banner', ['banner' => $banner]) @else @php $isFullWidth = ($banner->web_width ?? 'container') === 'full_width'; $bannerUrl = ($banner->image_urls[0] ?? null) ?: ($banner->link_url ?? null); /* Banners whose artwork advertises the app: the store badges printed inside the image can't be clicked, so real buttons are rendered underneath. Add a banner id here to give it the same treatment. 54 = "Farm Fresh ยท Just One Scan Away". */ $appPromoBannerIds = [54]; $showStoreButtons = in_array($banner->id ?? null, $appPromoBannerIds, true); @endphp
@if ($bannerUrl) @endif @if (!empty($banner->mobile_banner)) {{-- Portrait banner served to phones; desktop banner is the fallback --}} @endif {{ $banner->name }} @if ($bannerUrl) @endif @if ($showStoreButtons) @endif
@endif @endforeach