@extends('backend.layouts.app') @section('title', 'Edit Page') @push('styles') @endpush @section('content') @php $pageTitle = 'Edit Page'; $indexRoute = 'frontend-site.pages.index'; $indexLabel = 'Pages'; $indexRouteParams = ['site_id' => $page->site_fk]; $parentRoute = 'frontend-site.sites.index'; $parentLabel = 'Sites'; $componentCodes = $components->pluck('code')->toArray(); $componentBlocks = $components->map(fn($c) => ['code' => $c->code, 'name' => $c->name])->values()->toArray(); $grouped = $components->groupBy('category'); @endphp @include('backend.layouts.partials._page_header')

Update your page and component assignment.

@csrf @method('PUT')
Status status) ? 'checked' : '' }} class="hidden">
Default Page is_default) ? 'checked' : '' }} class="hidden">
$_shared — a special object to share data between Entry Script, Components, Page Content, and Layout. Use $_shared->key = value in Entry Script, then @{{ $_shared->key }} in Layout.
Must wrap Entry Script code in @@php ... @@endphp (or <?php ... ?>). Regular variables like $user will NOT reach the Layout — use $_shared->user instead.

Click to open Entry Script editor

@error('entry_script')
{{ $message }}
@enderror

Select components to use in this page. Then reference them as $code in the page content or layout below.

Page Content — rendered as @{!! $__page__ !!} inside the layout.
When Override with custom layout is selected and the layout is a full standalone page, this field is ignored — the layout alone is used.

Click to open Page Content editor

Layout — the HTML wrapper for the page.
Use site layout — wraps page content inside the site's global header/footer template. The layout field below is ignored.
Override with custom layout — the editor below becomes the full page output. Use for standalone pages like login, landing pages, etc. Page Content is ignored unless referenced as @{!! $__page__ !!}.

Click to open Layout editor

@error('layout')

{{ $message }}

@enderror
Cancel

Components

How it works: Use $component_code in your page content or layout. E.g. @{!! $hero !!}.
Drag & drop: Drag a component label onto any editor box below to insert it.
Autocomplete: Type $ in any editor to see component suggestions.
@forelse($grouped as $category => $comps)
@foreach($comps as $comp) @endforeach
@empty

No components available.

@endforelse
{{-- Editor Modal --}} @endsection @push('scripts') @endpush