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

{{ $page->title }}

@if ($page->is_published) Published @else Draft — not visible to visitors @endif
@csrf
@if ($page->is_reserved)
Built-in page. @if ($page->is_published) You're editing the live version of this page — visitors currently see the blocks below. Click "Unpublish" 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 not published yet — visitors still see the normal default page. Edit the blocks, use "Preview" below to check how it looks, then click "Publish" above when you're happy with it. @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->is_published) 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())

Freeform Canvas Page

Draw your layout — drag any element anywhere, resize it by hand, and it becomes real code on the page.

Open Freeform Canvas →
@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 --}}
Page Settings
@csrf @method('PUT') @include('admin.pages._form')
@endif @endsection