@php if (!function_exists('resolve_preview_image_url')) { function resolve_preview_image_url($imageState) { if (!$imageState) { return null; } if (is_array($imageState)) { $imageState = reset($imageState); } if (is_object($imageState) && method_exists($imageState, 'temporaryUrl')) { return $imageState->temporaryUrl(); } if (is_string($imageState)) { if (str_starts_with($imageState, 'http://') || str_starts_with($imageState, 'https://')) { return $imageState; } $url = \Illuminate\Support\Facades\Storage::url($imageState); $requestHost = request()->getHost(); if (str_contains($url, $requestHost)) { $parsedUrl = parse_url($url); return ($parsedUrl['path'] ?? '') . (isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : ''); } return $url; } return null; } } @endphp {{ $page?->title ?? 'Live Preview' }} - Live Preview
@if($sections->isEmpty())

কোনো পেজ ব্লক যোগ করা হয়নি

বাম পাশের এডিটর থেকে "Add to page Blocks" বাটনে ক্লিক করে হিরো ব্যানার, প্রোডাক্ট ফিচার বা কাস্টমার রিভিউ যোগ করুন।

@endif @foreach($sections as $sIdx => $section) @php $content = $section->content; @endphp @if($section->block_type === 'hero')

{{ $content['headline'] ?? 'আকর্ষণীয় শিরোনাম এখানে' }}

{{ $content['subheadline'] ?? 'উপ-শিরোনামের বিবরণ এখানে দিন।' }}

{{ $content['cta_text'] ?? 'অর্ডার করুন' }}
@php $heroImageUrl = resolve_preview_image_url($content['image_path'] ?? null); @endphp @if($heroImageUrl) Product Image @else
Product Image Placeholder
@endif
@endif @if($section->block_type === 'features')

{{ $content['title'] ?? 'প্রোডাক্টের বিশেষ সুবিধাসমূহ' }}

@if(isset($content['features_list'])) @foreach($content['features_list'] as $idx => $feat)
{{ $loop->iteration }}

{{ $feat['title'] }}

{{ $feat['description'] }}

@endforeach @endif
@endif @if($section->block_type === 'testimonials')

{{ $content['title'] ?? 'আমাদের কাস্টমাররা কী বলছেন' }}

@if(isset($content['testimonials_list'])) @foreach($content['testimonials_list'] as $idx => $testi)
@for($i = 0; $i < ($testi['rating'] ?? 5); $i++) ★ @endfor

"{{ $testi['feedback'] }}"

@php $avatarImageUrl = resolve_preview_image_url($testi['avatar'] ?? null); @endphp @if($avatarImageUrl) Avatar @else
{{ substr($testi['name'], 0, 1) }}
@endif

{{ $testi['name'] }}

Verified Buyer
@endforeach @endif
@endif @if($section->block_type === 'video_embed')

{{ $content['title'] ?? 'ভিডিওতে আমাদের প্রোডাক্ট দেখুন' }}

@if(isset($content['video_url'])) @php // Extract YouTube video ID preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $content['video_url'], $match); $videoId = $match[1] ?? null; @endphp @if($videoId) @else
Invalid Video URL
@endif @else
No Video Specified
@endif
@endif @if($section->block_type === 'faq')

{{ $content['title'] ?? 'সাধারণ কিছু প্রশ্ন ও উত্তর (FAQ)' }}

@if(isset($content['faqs'])) @foreach($content['faqs'] as $idx => $faq)

Q. {{ $faq['question'] }}

{{ $faq['answer'] }}

@endforeach @endif
@endif @if($section->block_type === 'custom_html')
{!! $content['code'] ?? '' !!}
@endif @if($section->block_type === 'express_checkout')

{{ $content['form_title'] ?? 'অর্ডার কনফার্ম করতে ফর্মটি পূরণ করুন' }}

প্রোডাক্টের মূল্য: ৳{{ number_format($page->landing_price ?: ($product->sale_price ?? $product->price), 2) }}
ডেলিভারি চার্জ: ৳৮০.০০
@endif @endforeach