@extends('admin.layouts.app') @section('title', 'Edit — '.$def['label']) @section('page-title', 'Page Builder · '.$def['label']) @section('content')
← All pages

{{ $def['icon'] }} {{ $def['label'] }}

{{ $publicUrl }} @if (! $converted) schema pending — sections still in the blade file @elseif ($status === 'draft') draft · live site shows the published version @elseif ($live) published @else inactive @endif {{ $page ? 'updated '.$page->updated_at->diffForHumans() : 'never edited (original content in use)' }}
↺ History ({{ $revisions->count() }}) 👁 Preview draft
@if (session('success'))
✔ {{ session('success') }}
@endif @if ($errors->any())
Nothing was saved — fix these first:
@endif
@if (! $converted)
Sections — not converted yet

This page is registered, but its markup still lives entirely in {{ ($def['view'] ?? '') }}. Nothing here changes the public page yet — the section schema is added when the page is converted to the shared section renderer. The SEO panel on the right does apply immediately after publishing.

View live page →
@else
@csrf @method('PUT') @foreach ($sections as $i => $s) @php $openOnError = collect($errors->keys())->contains( fn ($k) => str_starts_with($k, 'sections.'.$s['key']) ); @endphp
{{ $s['icon'] }} {{ $s['label'] }} {{ $s['key'] }} @if ($s['fieldCount'] > 0 && $s['liveCount'] === $s['fieldCount']) live {{ $s['liveCount'] }}/{{ $s['fieldCount'] }} @elseif ($s['liveCount'] > 0) live {{ $s['liveCount'] }} {{ $s['fieldCount'] - $s['liveCount'] }} pending @else pending · {{ $s['fieldCount'] }} fields @endif @if ($s['required'])required@endif @if (! $s['active'])hidden@endif
{{-- controls --}}
@if ($s['required']) Required — this section can never be hidden or removed. @endif @if ($s['reorderable']) @endif @if ($s['source'] === 'db') @endif
@if (! $s['wired'])
Not wired yet. No data-ps="{{ $s['key'] }}" hook was found in the blade file, so these values are stored but not rendered on the page. The badge turns live automatically once the section is rendered from Page Builder data.
@endif {{-- content fields --}} @foreach ($s['fields'] as $name => $field) @php $type = $field['type'] ?? 'text'; $label = $field['label'] ?? $name; $value = $s['content'][$name] ?? ($field['default'] ?? ($type === 'repeater' ? [] : '')); $err = $errors->first("sections.{$s['key']}.{$name}"); @endphp
@if ($type === 'textarea') @elseif ($type === 'image')
@if ($value)@endif jpeg / png / webp / gif · ≤ 2 MB · ≥ 200×100
@if ($field['alt'] ?? false) @endif @elseif ($type === 'color') @elseif ($type === 'select') @elseif ($type === 'toggle') @elseif ($type === 'repeater')
@foreach ((array) $value as $ri => $row)
Row {{ $ri + 1 }}
@foreach (($field['fields'] ?? []) as $subName => $subField)
@if (($subField['type'] ?? 'text') === 'textarea') @else @endif
@endforeach
@endforeach
@else @endif @if (($field['default'] ?? null) !== null && ! is_array($field['default']) && (string) $field['default'] !== '')
Default: {{ \Illuminate\Support\Str::limit((string) $field['default'], 90) }}
@endif @if ($err)
{{ $err }}
@endif
@endforeach {{-- style panel --}} @if ($s['styleFields'])
Section styling
@foreach ($s['styleFields'] as $styleKey => $styleDef)
@if (($styleDef['type'] ?? 'text') === 'color') {{-- can never be empty (it always reports #000000), so submitting it directly would silently override every colour the page defines itself. The named field is an EMPTY hidden input; the picker only syncs into it once the admin actually touches it. --}} @elseif (($styleDef['type'] ?? 'text') === 'select') @else @endif
@endforeach
Leave empty to keep the page's own styling. Values are validated and capped at 100 characters.
@endif
@endforeach
@endif {{-- sticky save bar (submits #pb-form via the form attribute) --}} @if ($converted)
All changes saved
👁 Preview draft
@endif
{{-- sidebar --}}
{{-- restore-section forms (kept OUTSIDE the editor form — HTML has no nested forms) --}} @foreach ($sections as $s) @endforeach @endsection