Jan 21, 2024
0
Level 1
The default number of Builder::make
Hello, I want to have the initial number for Builder::make, for example, 1 numbers to be active at creation time, and if possible, get the number live from categorical_factors
//->add(1) <-not work or ->default(1) <-not work or ->items(1) <-not work or ??
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('categoric_factors')
->numeric()
->minLength(1)
->maxLength(12)
->required()
->label('Categoric Factors'),
Section::make('All Generals Factorial')
->schema(
[
Builder::make('general_factorial')
->blocks([
Builder\Block::make('general_factorial')
->schema([
TextInput::make('name')
->label('Name')
->autofocus()
->required(),
TextInput::make('units')
->label('Units')
->required(),
TextInput::make('levels')
->label('Levels')
->default(2)
->disabled()
->required(),
TextInput::make('level_1')
->label('Level [1]')
->required(),
TextInput::make('level_2')
->label('Level [2]')
->required(),
])
->columns(5),
])
->addable(false)
->minItems(1)
->maxItems(12)
->cloneable()
->collapsible()
->label(false)
]
)->columnSpanFull(),
]);
}
Please or to participate in this conversation.