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')
....
Was this page helpful?