@extends('adminlte::page') @section('title', 'Page Sections') @section('content_header')

{{ $service->name }} - Page Sections

@stop @section('content')

Manage Page Sections

@csrf {{-- Add New Section Dropdown - Only show sections not yet added --}} @php $addedSections = $sections->pluck('section_name')->toArray(); $availableSections = [ // 'hero_banner' => 'Hero Banner', 'why_choose' => 'Why Choose Us', 'countries_table' => 'Countries Table', // 'how_to_apply' => 'How to Apply', 'popular_destinations' => 'Popular Destinations', 'pricing_card' => 'Pricing Card', 'in_person_section' => 'In Person Section', // ADD THIS 'remote_section' => 'Remote Section', // 'faq' => 'FAQ Section', // 'cta_banner' => 'CTA Banner', ]; $remainingSections = array_diff_key($availableSections, array_flip($addedSections)); @endphp
@if(count($remainingSections) > 0)
@else
All sections have been added!
@endif
{{ count($addedSections) }} of {{ count($availableSections) }} sections added
{{-- Sections Accordion --}} @if($sections->count() > 0)
@foreach($sections as $index => $section)

@php $content = $section->content ?? []; @endphp @php $prefix = "sections[{$section->id}][content]"; @endphp {{-- HERO BANNER --}} @if($section->section_name == 'hero_banner')
@if(!empty($content['side_image']))
@endif
{{-- WHY CHOOSE US --}} @elseif($section->section_name == 'why_choose')

@php $features = $content['features'] ?? [['icon' => '', 'title' => '', 'description' => '']]; @endphp @foreach($features as $i => $feature)
@endforeach
{{-- COUNTRIES TABLE (Simplified) --}} @elseif($section->section_name == 'countries_table')

@php $countries = $content['countries'] ?? [['name' => '', 'title' => '', 'subtitle' => '', 'link' => '']]; @endphp @foreach($countries as $i => $country)
@endforeach
{{-- HOW TO APPLY --}} @elseif($section->section_name == 'how_to_apply')
@if(!empty($content['side_image']))
@endif

@php $steps = $content['steps'] ?? [['title' => '', 'description' => '']]; @endphp @foreach($steps as $i => $step)
@endforeach
{{-- POPULAR DESTINATIONS --}} @elseif($section->section_name == 'popular_destinations')

@php $destinations = $content['destinations'] ?? [['title' => '', 'subtitle' => '', 'link' => '', 'image' => '']]; @endphp @foreach($destinations as $i => $dest)
@if(!empty($dest['image']))
@endif
@endforeach
{{-- PRICING CARD (New Section) --}} @elseif($section->section_name == 'pricing_card')


@php $pricingFeatures = $content['pricing_features'] ?? [['title' => '', 'value' => '']]; @endphp @foreach($pricingFeatures as $i => $pf)
@endforeach

{{-- FAQ --}} @elseif($section->section_name == 'faq')

@php $faqs = $content['faqs'] ?? [['question' => '', 'answer' => '']]; @endphp @foreach($faqs as $i => $faq)
@endforeach
{{-- CTA BANNER --}} @elseif($section->section_name == 'cta_banner')
{{-- IN PERSON SECTION --}} @elseif($section->section_name == 'in_person_section')

@php $inPersonItems = $content['in_person'] ?? [['title' => '', 'subtitle' => '']]; @endphp @foreach($inPersonItems as $i => $item)
@endforeach
{{-- REMOTE SECTION --}} @elseif($section->section_name == 'remote_section')

@php $remoteItems = $content['remote'] ?? [['title' => '', 'subtitle' => '']]; @endphp @foreach($remoteItems as $i => $item)
@endforeach
@endif
@endforeach
@else
No sections added yet. Use the dropdown above to add sections.
@endif
{{-- Delete Form --}} {{-- Add Section Form --}} @stop @section('js') @stop