public static function form(Form $form): Form
{
return $form
->columns(1)
->schema([
Forms\Components\Section::make()
->inlineLabel()
->columns(1)
->schema([
Forms\Components\TextInput::make('name')
->required(),
]),
Forms\Components\Section::make(__('Fields'))
->schema([
Forms\Components\Repeater::make('fields')
->itemLabel(fn (array $state): ?string => $state['name'] ?? __('Field'))
->label(false)
->collapsible()
->orderColumn('order')
->relationship()
->reorderableWithDragAndDrop(false)
->reorderableWithButtons(true)
->grid(1)
->columns(4)
->minItems(1)
->schema([
Forms\Components\TextInput::make('name')
->live(onBlur: true)
->required(),
Forms\Components\Select::make('type')
->options(fn () => FieldTypes::getArrayWithPrefix())
->required()
->reactive(),
])
])
]);
}
public static function form(Form $form): Form
{
return $form
->columns(1)
->schema([
Forms\Components\Section::make()
->inlineLabel()
->columns(1)
->schema([
Forms\Components\TextInput::make('name')
->required(),
]),
Forms\Components\Section::make(__('Fields'))
->schema([
Forms\Components\Repeater::make('fields')
->itemLabel(fn (array $state): ?string => $state['name'] ?? __('Field'))
->label(false)
->collapsible()
->orderColumn('order')
->relationship()
->reorderableWithDragAndDrop(false)
->reorderableWithButtons(true)
->grid(1)
->columns(4)
->minItems(1)
->schema([
Forms\Components\TextInput::make('name')
->live(onBlur: true)
->required(),
Forms\Components\Select::make('type')
->options(fn () => FieldTypes::getArrayWithPrefix())
->required()
->reactive(),
])
])
]);
}