Repeater edit value with array type.

I have an array with validation rules like
[
[
"rule" => "required",
"value" => null,
],
]
[
[
"rule" => "required",
"value" => null,
],
]
This is my edit form
Repeater
Repeater
field
Repeater::make('validationRuleInArray')
->schema([
Select::make('rule')
->options(function (Get $get) {
return $get('../../field') ? $get('../../field')->getValidationRules() : null;
})
->required(),
TextInput::make('value')
->nullable(),
])->columns(2)
->columnSpanFull(),
Repeater::make('validationRuleInArray')
->schema([
Select::make('rule')
->options(function (Get $get) {
return $get('../../field') ? $get('../../field')->getValidationRules() : null;
})
->required(),
TextInput::make('value')
->nullable(),
])->columns(2)
->columnSpanFull(),
Here the
validationRuleInArray
validationRuleInArray
is an attribute of the model and it returns array of validation rules like above array but in UI It shows only repeater add button. Please suggest me how to render an array value on
Repeater
Repeater
for edit form.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server