@extends('layouts.app') @section('title', 'Edit Content') @section('content') @include('partials.flash') @php $types = \App\Models\CourseContentBlock::TYPES; @endphp
arrow_back Builder

{{ $module->title }}

{{ $course->title }} · {{ $module->blocks->count() }} content blocks

{{-- Add block --}}

add_circle Add block

@csrf @if($module->blocks->isNotEmpty()) @php $blockHint = function ($b) { $d = $b->data ?? []; $t = data_get($d, 'text') ?: data_get($d, 'question') ?: data_get($d, 'front') ?: data_get($d, 'caption') ?: data_get($d, 'alt') ?: data_get($d, 'title') ?: ''; $t = trim(strip_tags((string) $t)); return $t !== '' ? ' — '.\Illuminate\Support\Str::limit($t, 30) : ''; }; @endphp @endif @foreach($types as $val => $label)
@include('admin.courses._block-field-group', ['type' => $val])
@endforeach
{{-- Live block list + preview + inline edit --}}

Screen content

@if($module->blocks->isNotEmpty()) @endif
@forelse($module->blocks as $block)
{{ $types[$block->type] ?? $block->type }}
@include('partials._content-block', ['block' => $block])
{{-- Inline edit form (standalone — not nested in the reorder form) --}}
@empty
view_agenda

No content yet

Add blocks on the left to build this screen.

@endforelse
{{-- Reorder + delete forms live outside the list so per-block edit forms don't nest. --}} @foreach($module->blocks as $block) @endforeach @endsection