@extends('admin.layouts.app') @section('title', $page->exists ? 'Edit landing page' : 'New landing page') @section('crumbs') Landing Pages {{ $page->exists ? $page->title : 'New' }} @endsection @section('content') @php $lines = fn ($rows, $a, $b) => collect($rows ?? [])->map(fn ($r) => $r[$a].' | '.$r[$b])->implode("\n"); $url = $page->exists ? route('landing.show', $page) : null; @endphp
@csrf @if ($page->exists) @method('PUT') @endif
{{-- 1. product --}}

① Product & offer

@include('admin.partials.field', ['name' => 'title', 'label' => 'Page name (shudhu admin dekhbe)', 'value' => $page->title, 'required' => true, 'placeholder' => 'e.g. Denim Jeans Eid Offer']) @include('admin.partials.slug-field', ['model' => $page, 'from' => 'f_title', 'source' => 'title'])
Size, color, chobi ar stock ei product theke ashbe. @error('product_id')
{{ $message }}
@enderror
@include('admin.partials.field', ['name' => 'offer_price', 'label' => 'Offer price (৳)', 'type' => 'number', 'value' => $page->offer_price, 'attrs' => 'min="0" step="1"', 'hint' => 'Faka rakhle product er dam. Product er dam er cheye kom dile kete deya dam dekhabe.'])
@include('admin.partials.check', ['name' => 'free_shipping', 'label' => 'Free delivery', 'checked' => $page->free_shipping, 'hint' => 'Delivery charge nebe na'])
{{-- 2. hero --}}

② Upore boro banner (hero)

@include('admin.partials.field', ['name' => 'badge_text', 'label' => 'Choto badge', 'value' => $page->badge_text, 'placeholder' => '🔥 সীমিত সময়ের অফার']) @include('admin.partials.field', ['name' => 'button_text', 'label' => 'Button er lekha', 'value' => $page->button_text]) @include('admin.partials.field', ['name' => 'headline', 'label' => 'Headline (boro lekha)', 'value' => $page->headline, 'required' => true, 'full' => true, 'placeholder' => 'e.g. ঈদের সেরা ডেনিম জিন্স — এখন মাত্র ৳১,৪৯০']) @include('admin.partials.field', ['name' => 'subheadline', 'label' => 'Sub-headline', 'type' => 'textarea', 'value' => $page->subheadline, 'full' => true, 'rows' => 2, 'placeholder' => 'Product ta keno kinbe, 1-2 line e']) @include('admin.partials.image', ['name' => 'hero_image', 'label' => 'Banner er chobi', 'path' => $page->hero_image, 'hint' => 'Faka rakhle product er chobi dekhabe. Model pore ache emon chobi bhalo kaj kore. Max 4 MB.']) @include('admin.partials.field', ['name' => 'video_url', 'label' => 'YouTube video (optional)', 'value' => $page->video_url, 'full' => true, 'placeholder' => 'https://youtu.be/...', 'hint' => 'Product er video thakle banner er niche dekhabe.']) @include('admin.partials.field', ['name' => 'countdown_end', 'label' => 'Offer sesh hobe (countdown)', 'type' => 'datetime-local', 'value' => $page->countdown_end?->format('Y-m-d\TH:i'), 'hint' => 'Faka rakhle countdown dekhabe na.'])
{{-- 3. sections --}}

③ Section gula

Faka rakhle oi section dekhabe na
@include('admin.partials.field', ['name' => 'features', 'label' => '✅ Keno kinben (ek line e ekta)', 'type' => 'textarea', 'full' => true, 'rows' => 5, 'value' => implode("\n", $page->features ?? [])]) @include('admin.partials.field', ['name' => 'reviews', 'label' => '⭐ Customer review (Nam | Review)', 'type' => 'textarea', 'full' => true, 'rows' => 4, 'value' => $lines($page->reviews, 'name', 'text'), 'placeholder' => "Rakib, Mirpur | কাপড়ের মান অসাধারণ, সাইজ একদম পারফেক্ট।\nSabbir, Chattogram | দুই দিনে ডেলিভারি পেয়েছি।", 'hint' => 'Prottek line e: nam, tarpor | dag, tarpor review.']) @include('admin.partials.field', ['name' => 'faqs', 'label' => '❓ FAQ (Proshno | Uttor)', 'type' => 'textarea', 'full' => true, 'rows' => 4, 'value' => $lines($page->faqs, 'q', 'a'), 'hint' => 'Prottek line e: proshno, tarpor | dag, tarpor uttor.'])
{{-- design --}}

🎨 Design

@include('admin.partials.field', ['name' => 'theme_color', 'label' => 'Main color', 'type' => 'color', 'value' => $page->theme_color, 'full' => true, 'hint' => 'Banner, button ar heading er rong']) @include('admin.partials.field', ['name' => 'accent_color', 'label' => 'Highlight color', 'type' => 'color', 'value' => $page->accent_color, 'full' => true, 'hint' => 'Badge, dam ar countdown er rong'])
@foreach ([['#0b2d6b', '#ffb400', 'Navy'], ['#111827', '#f59e0b', 'Black'], ['#7f1d1d', '#fbbf24', 'Maroon'], ['#065f46', '#facc15', 'Green'], ['#5b21b6', '#f472b6', 'Purple'], ['#c2410c', '#fde047', 'Orange']] as [$m, $a, $n]) @endforeach
@include('admin.partials.check', ['name' => 'is_active', 'label' => 'Page live', 'checked' => $page->is_active, 'hint' => 'Off korle customer page ta dekhbe na'])
@if ($url)Open ↗@endif
@if ($url)

🔗 Ad er link

{{ $page->orders()->count() }} order ei page theke esheche.

📱 Preview

Save korle update hobe
@endif
@endsection @push('scripts') @endpush