@php $slides = $slides ?? collect(); $isSingle = $slides->count() <= 1; @endphp
@forelse ($slides as $slide) @php $hasTitle = $slide->show_title && !empty($slide->title); $hasSubtitle = $slide->show_subtitle && !empty($slide->subtitle); $hasButton = $slide->show_button && !empty($slide->button_text) && !empty($slide->button_url); $hasContent = $hasTitle || $hasSubtitle || $hasButton; $altText = $hasTitle ? $slide->title : 'Слайд на главной странице'; @endphp
{{ $altText }}
@if ($hasContent)
@if ($hasTitle)

{{ $slide->title }}

@endif @if ($hasSubtitle)

{{ $slide->subtitle }}

@endif @if ($hasButton) {{ $slide->button_text }} @endif
@endif
@empty

{{ $fallbackTitle ?? 'Собирайте ПК быстрее' }}

{{ $fallbackText ?? 'Загрузите баннеры в админке, чтобы вывести акции и подборки товаров на главной странице.' }}

@if (!empty($fallbackUrl)) {{ $fallbackButton ?? 'Открыть каталог' }} @endif
@endforelse