@extends('admin.layouts.app') @section('title', 'Edit: ' . $label) @section('page-title', 'Home Page') @section('content')

{{ $icon }} {{ $label }}

Section key {{ $key }} · @if($onPage) this section is rendered on the homepage @else this row exists in the database but the blade never renders it @endif

← Back
@if(session('success'))
✅ {{ session('success') }}
@endif @if($errors->any())
⚠️ {{ $errors->first() }}
@endif
@csrf @method('PUT') {{-- ── VISIBILITY ─────────────────────────────────────────── --}}

👁️ Show on the site

Hides this whole section on the homepage. Nothing else about it changes.

{{ old('is_visible', $section->is_visible) ? 'Visible' : 'Hidden' }} {{ $onPage ? 'on the homepage' : 'not rendered anyway' }}
{{-- ── STYLE ──────────────────────────────────────────────── --}} @php $hasTitle = trim((string) ($meta['title_target'] ?? '')) !== ''; $hasIcon = trim((string) ($meta['icon_target'] ?? '')) !== ''; $panel = []; foreach ($styles as $sk => $sd) { $t = $sd['target'] ?? ''; if ($t === '') { $panel[$sk] = $sd; } elseif ($t === '{title}' && $hasTitle) { $panel[$sk] = $sd; } elseif ($t === '{icon}' && $hasIcon) { $panel[$sk] = $sd; } } @endphp

🎨 Style

Colours, fonts and icons for this section only. Leave a field empty to keep the built-in look.

@if(!$onPage)
This section is not rendered on the page, so style changes will have no visible effect until the blade uses it.
@endif @if($panel === [])

This section has no styleable heading or icon — only its background colour applies.

@else
@foreach($panel as $sk => $sd) @php $val = old("style.$sk", $section->style[$sk] ?? ''); @endphp
@if(($sd['type'] ?? 'text') === 'color')
@elseif(($sd['type'] ?? 'text') === 'select') @else @endif @if(!empty($sd['desktop'])) Applies on desktop only — phones and tablets keep their own sizing. @endif
@endforeach
@endif
{{-- ── CONTENT ────────────────────────────────────────────── --}} @php $liveCount = 0; foreach (array_keys($fields) as $fk) { if (isset($reads[$fk])) $liveCount++; } @endphp

✏️ Content

@if($fields === []) This section's text and images are still built into the page — nothing to edit yet. @else {{ $liveCount }} of {{ count($fields) }} fields are live on the page right now. @endif

@if($fields === [])
Content is hardcoded. The blade renders its own copy for this section, so there is nothing to save here yet. Visibility and Style above still work. We'll open up its content when we do this section.
@else @php $content = (array) old('content', (array) $section->content); @endphp @if($liveCount === 0 && $fields !== [])
None of these fields reach the page yet. The blade is still using its built-in copy for this section. Values save fine — they'll start showing the moment we wire the blade, which we'll do section by section.
@elseif($liveCount < count($fields))
Fields marked "not applied yet" are saved but not read by the page's blade — those get wired up section by section. The rest take effect immediately.
@endif
@foreach($fields as $fk => $fd) @php $type = $fd['type'] ?? 'text'; $labelF = $fd['label'] ?? $fk; $isLive = isset($reads[$fk]); $isIconField = $type === 'text' && (strtolower((string) $fk) === 'icon' || str_contains(strtolower((string) $labelF), 'icon')); @endphp @if($type === 'repeater')
@php $rowsData = is_array($content[$fk] ?? null) ? $content[$fk] : []; @endphp @forelse($rowsData as $ri => $r)
#{{ $ri + 1 }}
@foreach(($fd['fields'] ?? []) as $sk => $sd) @php $stype = $sd['type'] ?? 'text'; // a plain text field holding a Font Awesome class gets the library $sisIcon = $stype === 'text' && (strtolower((string) $sk) === 'icon' || str_contains(strtolower((string) ($sd['label'] ?? '')), 'icon')); @endphp
@if($stype === 'textarea') @elseif($stype === 'color')
@elseif($stype === 'select') @elseif($stype === 'repeater') @php $nkey = $fk . '|' . $ri . '|' . $sk; $nrows = is_array($r[$sk] ?? null) ? $r[$sk] : []; $nfields = (array) ($sd['fields'] ?? []); @endphp
@forelse($nrows as $ci => $cr)
#{{ $ci + 1 }}
@foreach($nfields as $ck => $cd) @php $ctype = $cd['type'] ?? 'text'; $cname = 'content[' . $fk . '][' . $ri . '][' . $sk . '][' . $ci . '][' . $ck . ']'; $cval = is_array($cr[$ck] ?? null) ? '' : (string) ($cr[$ck] ?? ''); $cisIcon = $ctype === 'text' && (strtolower((string) $ck) === 'icon' || str_contains(strtolower((string) ($cd['label'] ?? '')), 'icon')); $cpid = 'n-' . $nkey . '-' . $ci . '-' . $ck; @endphp
@if($ctype === 'textarea') @elseif($ctype === 'color')
@elseif($ctype === 'select') @elseif($ctype === 'repeater') — @elseif($cisIcon)
{!! $cval !== '' ? '' : '' !!}
@else @endif
@endforeach
@empty

No rows yet.

@endforelse
@else @if($sisIcon) @php $pid = 'c-' . $fk . '-' . $ri . '-' . $sk; $cur = (string) ($r[$sk] ?? ''); @endphp
{!! $cur !== '' ? '' : '' !!}
@else @endif @endif
@endforeach
@empty

No rows yet — the page is showing its built-in defaults.

@endforelse
@elseif($type === 'textarea')
@elseif($type === 'color')
@elseif($type === 'select')
@else
@if($isIconField) @php $pid = 'c-' . $fk; $cur = (string) ($content[$fk] ?? ''); @endphp
{!! $cur !== '' ? '' : '' !!}
@else @if(($fd['default'] ?? '') !== '') Default: {{ Str::limit((string) $fd['default'], 70) }} @endif @endif
@endif @endforeach
@endif
Cancel
{{-- icon library, available to every icon field on this screen --}} @include('admin.partials._icon_picker') {{-- the locked colour palette, on every colour option of this screen --}} @include('shared.website.customize._color_picker_standalone') {{-- The palette writes the confirmed colour into its own `.cp-hidden` input, while this form saves through the hex text field sitting next to the swatch. Mirror the pick across so picking and typing stay in step. The palette partial itself is not modified — only hooked from here. --}} @endsection