@extends('layouts.admin') @section('title', 'Edit Page') @section('eyebrow', 'Page Editor') @section('heading', $page->name) @section('header_actions')
@endsection @section('content') @php $pageSections = $pageSections ?? $page->sectionMap(); $heroSlides = collect(old('hero_slide_images', []))->isNotEmpty() ? collect(old('hero_slide_images', []))->values()->map( fn ($image, $index) => [ 'image' => $image, 'label' => old("hero_slide_labels.$index"), ], )->all() : array_values($pageSections['hero_slides'] ?? []); if ($page->slug === 'home') { $heroSlides = array_pad($heroSlides, 5, ['image' => '', 'label' => '']); } $homeHero = array_merge([ 'eyebrow' => '', 'headline' => '', 'subheadline' => '', 'primary_label' => '', 'secondary_label' => '', ], old('hero', $pageSections['hero'] ?? [])); $homeFeaturesSection = array_merge([ 'title' => '', ], old('features_section', $pageSections['features_section'] ?? [])); $homeTreatmentsSection = array_merge([ 'eyebrow' => '', 'title' => '', ], old('treatments_section', $pageSections['treatments_section'] ?? [])); $homeStepsSection = array_merge([ 'eyebrow' => '', 'title' => '', ], old('steps_section', $pageSections['steps_section'] ?? [])); $homeReasonsSection = array_merge([ 'title' => '', ], old('reasons_section', $pageSections['reasons_section'] ?? [])); $homeTherapistsSection = array_merge([ 'title' => '', 'subtitle' => '', ], old('therapists_section', $pageSections['therapists_section'] ?? [])); $homeTestimonialsSection = array_merge([ 'eyebrow' => '', 'title' => '', ], old('testimonials_section', $pageSections['testimonials_section'] ?? [])); $homeFeatures = array_pad(old('features_items', $pageSections['features_items'] ?? []), 6, ['icon' => '', 'title' => '', 'text' => '']); $homeSteps = array_pad(old('steps_items', $pageSections['steps_items'] ?? []), 5, ['icon' => '', 'title' => '', 'desc' => '']); $homeReasons = array_pad(old('reasons_items', $pageSections['reasons_items'] ?? []), 5, ['icon' => '', 'text' => '']); $aboutHighlights = array_pad(old('about_highlights', $pageSections['about_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $aboutStory = array_merge([ 'eyebrow' => '', 'title' => '', 'intro' => '', 'vision_title' => '', 'vision_text' => '', 'mission_title' => '', 'mission_text' => '', 'promise_title' => '', 'promise_text' => '', 'reasons_title' => '', 'reasons_copy' => '', 'image' => '', ], old('about_story', $pageSections['about_story'] ?? [])); $aboutReasons = array_pad(old('reason_items', $pageSections['reason_items'] ?? []), 5, ['icon' => '', 'text' => '']); $treatmentHighlights = array_pad(old('treatments_highlights', $pageSections['treatments_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $pricingHighlights = array_pad(old('pricing_highlights', $pageSections['pricing_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $therapistHighlights = array_pad(old('therapist_highlights', $pageSections['therapist_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $contactItems = array_pad(old('contact_items', $pageSections['contact_items'] ?? []), 4, ['icon' => '', 'label' => '', 'value' => '', 'href' => '']); $serviceAreaHighlights = array_pad(old('service_area_highlights', $pageSections['service_area_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $faqItems = array_pad(old('faq_items', $pageSections['faq_items'] ?? []), 8, ['question' => '', 'answer' => '']); $bookingHighlights = array_pad(old('booking_highlights', $pageSections['booking_highlights'] ?? []), 3, ['label' => '', 'title' => '', 'text' => '']); $bookingChecklist = array_pad(old('booking_checklist', $pageSections['booking_checklist'] ?? []), 6, ''); $bookingSteps = array_pad(old('booking_steps', $pageSections['booking_steps'] ?? []), 5, ['title' => '', 'text' => '']); @endphp @endsection