Increase a select's option by the amount of reapeater in the form
I have this select in my form which is inside a repeater
"Forms\Components\Wizard\Step::make('RulesCategoryDependent')
->label('Categories by Dependents')
->schema([
Forms\Components\Repeater::make('rules_category_dependents.dependent_category')
->label('Table')
->schema([
Forms\Components\Select::make('dependency_class')
->label('Select dependent class')
->options([
'1C' => '1st class',
'2C' => '2nd class',
'3C' => '3rd class',
'4C' => '4th class'
])
])"
I need that when the number of 'repeater' is greater than four, another option is added to the selects. Example: if it has 5 it adds " '5C' => '5th class'", if it has 6 " '6C' => '6th class'". How to do this?
"Forms\Components\Wizard\Step::make('RulesCategoryDependent')
->label('Categories by Dependents')
->schema([
Forms\Components\Repeater::make('rules_category_dependents.dependent_category')
->label('Table')
->schema([
Forms\Components\Select::make('dependency_class')
->label('Select dependent class')
->options([
'1C' => '1st class',
'2C' => '2nd class',
'3C' => '3rd class',
'4C' => '4th class'
])
])"
I need that when the number of 'repeater' is greater than four, another option is added to the selects. Example: if it has 5 it adds " '5C' => '5th class'", if it has 6 " '6C' => '6th class'". How to do this?