@if($currentView === 'dashboard')

Творите дома

Выберите направление

@foreach($categoriesData as $cat) @php $bgImage = $cat['image'] ? asset('storage/' . $cat['image']) : 'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&q=80&w=400'; @endphp
{{ $cat['name'] }}
{{ $cat['count'] }} {{ trans_choice('урок|урока|уроков', $cat['count']) }}

{{ $cat['name'] }}

@endforeach
@elseif($currentView === 'list')

{{ $selectedCategory }}

@if($subcategories->count() > 0)
@foreach($subcategories as $sub) @endforeach
@endif
@forelse($tutorials as $tutorial) @php $img = $tutorial->image ? asset('storage/' . $tutorial->image) : 'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&q=80&w=400'; @endphp
{{ $tutorial->title }}
@if($tutorial->kit_price)
🛍️ Бокс
@endif

{{ $tutorial->title }}

@if($tutorial->kit_price)
Набор для дома: {{ $tutorial->kit_price }} тг
@endif @if($tutorial->subcategory)
{{ $tutorial->subcategory }}
@endif
@empty
Уроки скоро появятся 🎬
@endforelse
@elseif($currentView === 'show' && $selectedTutorial)
@if($selectedTutorial->category)

{{ $selectedTutorial->category }} @if($selectedTutorial->subcategory) • {{ $selectedTutorial->subcategory }} @endif

@endif

{{ $selectedTutorial->title }}

@php $rawUrl = trim($selectedTutorial->youtube_url); $youtubeId = null; if (preg_match('/(?:youtu\.be\/|youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?|live|shorts)\/|.*[?&]v=))([a-zA-Z0-9_-]{11})/i', $rawUrl, $matches)) { $youtubeId = $matches[1]; } elseif (preg_match('/embed\/([a-zA-Z0-9_-]{11})/i', $rawUrl, $matches)) { $youtubeId = $matches[1]; } elseif (preg_match('/^[a-zA-Z0-9_-]{11}$/', $rawUrl)) { $youtubeId = $rawUrl; } @endphp @if($youtubeId)
@else
🚨 Система не смогла распознать ссылку.
{{ $rawUrl ? $rawUrl : 'ПУСТОТА' }}
@endif
title}» и хочу заказать набор для дома 🎨") }}" target="_blank" class="animate-shine overflow-hidden w-full flex justify-between items-center px-5 py-4 rounded-[1.5rem] font-extrabold transition-all border border-transparent bg-brand text-white shadow-lg shadow-brand/30 hover:bg-pink-600 hover:scale-[1.02] mb-3 relative"> 🛍️ Заказать набор для дома @if($selectedTutorial->kit_price || $selectedTutorial->kit_items_count || ($selectedTutorial->kit_images && count($selectedTutorial->kit_images) > 0))
@if($selectedTutorial->kit_price || $selectedTutorial->kit_items_count)
@if($selectedTutorial->kit_items_count)
В наборе: {{ $selectedTutorial->kit_items_count }}
@endif @if($selectedTutorial->kit_price)
{{ $selectedTutorial->kit_price }} тг
@endif
@endif @if($selectedTutorial->kit_images && count($selectedTutorial->kit_images) > 0) @php $galleryImages = array_map(function($img) { return asset('storage/' . $img); }, $selectedTutorial->kit_images); @endphp
@foreach($selectedTutorial->kit_images as $index => $image)
Фото набора
@endforeach
@endif
@endif

Об уроке

@php $shareUrl = url('/tutorials?tutorialId=' . $selectedTutorial->id); @endphp
@if($selectedTutorial->description)
{!! $selectedTutorial->description !!}
@endif @if($selectedTutorial->materials)

Вам понадобятся:

{!! $selectedTutorial->materials !!}
@endif
@endif