<?php
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('')
->schema([
TextInput::make('Name')
->required()
->minLength(2)
->maxLength(191),
Toggle::make('IsActive')
->default(true)
->onColor('success')
->offColor('danger'),
]),
Section::make('Details')
->schema([
Repeater::make('Detail')
->schema([
TextInput::make('Name'),
Toggle::make('IsRequired')
->default(false)
->onColor('success')
->offColor('danger')
->label('require'),
])
->label('Detail')
->deleteAction(
fn (Forms\Components\Actions\Action $action) => $action->requiresConfirmation(),
)
->addActionLabel('Add Detail')
->relationship()
->reorderableWithButtons()
->orderColumn('Rank')
->cloneable()
]),
]);
}
<?php
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('')
->schema([
TextInput::make('Name')
->required()
->minLength(2)
->maxLength(191),
Toggle::make('IsActive')
->default(true)
->onColor('success')
->offColor('danger'),
]),
Section::make('Details')
->schema([
Repeater::make('Detail')
->schema([
TextInput::make('Name'),
Toggle::make('IsRequired')
->default(false)
->onColor('success')
->offColor('danger')
->label('require'),
])
->label('Detail')
->deleteAction(
fn (Forms\Components\Actions\Action $action) => $action->requiresConfirmation(),
)
->addActionLabel('Add Detail')
->relationship()
->reorderableWithButtons()
->orderColumn('Rank')
->cloneable()
]),
]);
}