| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- {{--
- Blade-шаблон блока «Сетка марок».
- $data:
- label — надпись над заголовком
- heading — заголовок секции
- makes — массив строк с названиями марок (выбранных в админке из справочника)
- Логотипы берутся из public/images/marks/{slug}.png (статика).
- Slug генерируется через Str::slug($make) — «Land Rover» → land-rover.
- Если файл не найден — показывается первая буква марки.
- --}}
- @php
- $makes = $data['makes'] ?? [];
- sort($makes);
- @endphp
- @if (!empty($makes))
- <section class="brands-section">
- <div class="container">
- @if (($data['label'] ?? '') || ($data['heading'] ?? ''))
- <div style="margin-bottom:clamp(20px,4vw,44px)">
- @if ($data['label'] ?? '')
- <div class="brands-label">{{ $data['label'] }}</div>
- @endif
- @if ($data['heading'] ?? '')
- <h2 style="color:#fff;margin:0">{{ $data['heading'] }}</h2>
- @endif
- </div>
- @endif
- <div class="brands-grid">
- @foreach ($makes as $make)
- @php
- $slug = \Illuminate\Support\Str::slug($make);
- $logoPath = 'images/marks/' . $slug . '.png';
- $hasLogo = file_exists(public_path($logoPath));
- @endphp
- <a href="{{ route('catalog', ['make' => $make]) }}" class="brand-tile">
- <div class="brand-logo">
- @if ($hasLogo)
- <img src="{{ asset($logoPath) }}"
- alt="{{ $make }}"
- class="brand-logo-img">
- @else
- <span class="brand-logo-letter">{{ mb_strtoupper(mb_substr($make, 0, 1)) }}</span>
- @endif
- </div>
- <div class="brand-name">{{ $make }}</div>
- </a>
- @endforeach
- </div>
- </div>
- </section>
- @endif
|