@extends('layouts.admin') @section('title', $isCreate ? 'New definition' : $definition->name) @section('content') @php $schema = old('fields', $schema ?? $definition->fields ?? []); if (! is_array($schema) || $schema === []) { $schema = [['key' => 'title', 'name' => 'Title', 'type' => 'single_line_text', 'required' => true, 'help' => '', 'position' => 0]]; } @endphp
@csrf @unless($isCreate) @method('PUT') @endunless Cancel @if($errors->any())
{{ $errors->first() }}
@endif
isProtected())> @if(! $isCreate && $definition->isProtected()) @endif
@foreach($schema as $i => $field) @php $field = is_array($field) ? $field : ['key' => (string) $field, 'name' => (string) $field, 'type' => 'single_line_text']; @endphp
@endforeach
@endsection