@php /* |-------------------------------------------------------------------------- | Existing Sections |-------------------------------------------------------------------------- */ $existingSections = $landingPage->exists ? $landingPage ->sections ->keyBy('type') : collect(); /* |-------------------------------------------------------------------------- | Basic Values |-------------------------------------------------------------------------- */ $productId = old( 'product_id', $landingPage->product_id ); $title = old( 'title', $landingPage->title ); $slug = old( 'slug', $landingPage->slug ); /* |-------------------------------------------------------------------------- | Theme |-------------------------------------------------------------------------- */ $theme = array_merge( \App\Models\LandingPage::defaultTheme(), (array) ( $landingPage->theme ?? [] ) ); /* |-------------------------------------------------------------------------- | SEO |-------------------------------------------------------------------------- */ $seo = (array) ( $landingPage->seo ?? [] ); /* |-------------------------------------------------------------------------- | Section Field Value |-------------------------------------------------------------------------- */ $fieldValue = function ( string $type, string $path, mixed $default = '' ) use ( $existingSections, $sectionDefaults ) { $section = $existingSections->get( $type ); $source = $section ? (array) $section->content : (array) data_get( $sectionDefaults, $type . '.content', [] ); return data_get( $source, $path, $default ); }; /* |-------------------------------------------------------------------------- | Section Enabled |-------------------------------------------------------------------------- */ $sectionEnabled = function ( string $type ) use ( $existingSections, $sectionDefaults ): bool { $section = $existingSections->get( $type ); if ($section) { return (bool) $section->is_enabled; } return (bool) data_get( $sectionDefaults, $type . '.is_enabled', true ); }; /* |-------------------------------------------------------------------------- | Section Sort |-------------------------------------------------------------------------- */ $sectionSort = function ( string $type, int $fallback ) use ( $existingSections, $sectionDefaults ): int { $section = $existingSections->get( $type ); if ($section) { return (int) $section->sort_order; } return (int) data_get( $sectionDefaults, $type . '.sort_order', $fallback ); }; /* |-------------------------------------------------------------------------- | Media URL |-------------------------------------------------------------------------- */ $mediaUrl = function ( mixed $reference ): ?string { return \App\Models\LandingPage::resolveMediaUrl( $reference ); }; /* |-------------------------------------------------------------------------- | Section Rows |-------------------------------------------------------------------------- */ $sectionRows = collect( \App\Models\LandingPage::SECTION_TYPES ) ->map( function ( $type, $index ) use ( $sectionSort ) { return [ 'type' => $type, 'sort' => $sectionSort( $type, ($index + 1) * 10 ), ]; } ) ->sortBy('sort') ->values(); /* |-------------------------------------------------------------------------- | Section Icons |-------------------------------------------------------------------------- */ $sectionIcons = [ 'hero' => 'fa-solid fa-wand-magic-sparkles', 'benefits' => 'fa-solid fa-list-check', 'promo' => 'fa-solid fa-bullhorn', 'usage' => 'fa-solid fa-book-open', 'reviews' => 'fa-solid fa-star', 'order' => 'fa-solid fa-cart-shopping', 'footer' => 'fa-solid fa-window-maximize', ]; /* |-------------------------------------------------------------------------- | Section Descriptions |-------------------------------------------------------------------------- */ $sectionDescriptions = [ 'hero' => 'Heading, customer count, slider images and avatars', 'benefits' => 'Product benefits and feature information', 'promo' => 'Promotional banner, image and call-to-action', 'usage' => 'Usage instructions and product highlights', 'reviews' => 'Customer experience screenshot gallery', 'order' => 'Order form, free shipping and checkout text', 'footer' => 'Contact number, WhatsApp and copyright', ]; /* |-------------------------------------------------------------------------- | Builder Key |-------------------------------------------------------------------------- */ $builderKey = $landingPage->exists ? 'landing-page-' . $landingPage->id : 'landing-page-new'; @endphp {{-- ====================================================================== EXTERNAL CSS / ICONS ====================================================================== --}} {{-- ====================================================================== BUILDER DESIGN ====================================================================== --}} {{-- ====================================================================== ROOT ====================================================================== --}}
Product অনুযায়ী dynamic landing page তৈরি করুন। প্রতিটি section independently edit, enable/disable, collapse এবং drag করে reorder করতে পারবেন।
{{ $editing ? 'Editing existing landing page' : 'Creating new landing page' }}