@extends('admin.layout') @section('title', 'Edit Page — '.$page->title) @section('content')

{{ $page->title }}

@if ($page->is_reserved) @if (! $page->is_enabled) Disabled — visitors get "not found" @elseif ($page->is_published) Live — customized design @else Live — default design @endif @else @if ($page->is_published) Published @else Draft — not visible to visitors @endif @endif
@csrf
@if ($page->is_reserved)
@csrf
@endif
@if ($page->is_reserved)
Built-in page. @if (! $page->is_enabled) This page is currently disabled — visiting it shows "not found" and any menu link to it is hidden. Click "Enable Page" above to bring it back. @elseif ($page->is_published) You're editing the live version of this page — visitors currently see the blocks below. Click "Use Default Design" above any time to instantly go back to the default design. @else The blocks below have been pre-filled to match the current live design, but the page itself is showing its default design — click "Use Customized Design" above to switch visitors to the version below instead. Edit the blocks and use "Preview" to check how it looks first. @endif
@endif @php $reservedUrls = ['home' => '/', 'models' => '/models', 'promotions' => '/promotions', 'news' => '/news', 'faq' => '/faq']; $liveUrl = $page->is_reserved ? ($reservedUrls[$page->slug] ?? '/') : route('pages.show', $page); @endphp
@if (!$page->isVisual()) Preview → @endif @if ($page->isLiveVisible()) View live page → @endif
@if ($page->isVisual())

Visual Drag & Drop Page (legacy)

Design this page freely — drag, drop, and style any element, no fixed sections.

Open Visual Designer →
@elseif ($page->isCanvas()) @if ($page->blocks->isNotEmpty())
Heads up: switching to the canvas only carries over each block's plain text — richer blocks (an image, buttons, a stats row, etc.) lose that extra design and become plain headings below. If the preview below doesn't match what customers currently see, switch back to the block editor — your original blocks were never deleted and are exactly as they were.
@csrf
@endif

Freeform Canvas Page

This is exactly what's saved in the canvas right now. Click it to start editing — drag anything anywhere, resize it, or double-click text to change it.

Edit Layout →
@if ($page->canvasElements->isEmpty())

Nothing drawn on this page yet.

Open Freeform Canvas →
@else
@include('partials.canvas-render', [ 'elements' => $page->canvasElements, 'designWidth' => \App\Http\Controllers\Admin\PageCanvasController::DESIGN_WIDTH, ])
Click to edit →
@endif
@else @if ($page->blocks->isNotEmpty())
Want full freeform control? Switch this page to the drag-anywhere canvas — your current blocks are laid out for you at their current height so nothing jumps, then you can drag anything into place.
@csrf
@endif @php $blockTypes = \App\Models\PageBlock::types(); $createUrl = route('admin.pages.blocks.create', $page); // A little Blade partial-in-place: the "+" you hover between any two // blocks (and before the first / after the last) — exactly like the // WordPress block editor's inserter. Clicking it opens a small menu // of block types; picking one creates it at that exact position. $inserter = function (int $position, bool $prominent = false) use ($blockTypes, $createUrl) { return view('admin.pages.blocks._inserter', [ 'position' => $position, 'prominent' => $prominent, 'blockTypes' => $blockTypes, 'createUrl' => $createUrl, ])->render(); }; @endphp
{{-- CANVAS: a live preview of the real page, edited in place — click any text to type directly into it, drag a block's ⠿ handle to reorder it, or hover between blocks for a "+" to insert a new one right there. --}}

This is what the page actually looks like. Click any text to edit it, drag the ⠿ handle to reorder a block, or hover between blocks for a "+" to add one there.

{!! $inserter(0, $page->blocks->isEmpty()) !!} @foreach ($page->blocks as $block)
@include('blocks.'.$block->type, ['data' => $block->data, 'adminEditable' => true])
{!! $inserter($loop->iteration) !!} @endforeach
{{-- TOOLS PANEL --}}

Add a Block

Drag one onto the page, or hover between blocks and click the "+".

@foreach ($blockTypes as $key => $label)
⠿{{ $label }}
@endforeach
Page Settings
@csrf @method('PUT') @include('admin.pages._form')
@endif @endsection