SyntaxErrar
SyntaxErrar
FFilament
Created by SyntaxErrar on 7/31/2023 in #❓┊help
Repeater Index
Is it possible to get the index value in a repeater? I want to set a field based on the index. something like:
Repeater::make('addresses')
->relationship()
->minItems(1)
->maxItems(2)
->schema([
Select::make('billing_or_delivery')
->required()
->options([
'Delivery' => 'Delivery',
'Billing' => 'Billing',
])
->default($index ? 'Delivery' : 'Billing')
....
Repeater::make('addresses')
->relationship()
->minItems(1)
->maxItems(2)
->schema([
Select::make('billing_or_delivery')
->required()
->options([
'Delivery' => 'Delivery',
'Billing' => 'Billing',
])
->default($index ? 'Delivery' : 'Billing')
....
4 replies