Reputation: 5712
I am trying to access field_1
value inside the repeater
return $form->schema([
Select::make('field_1')->reactive()->options(['a','b','c']),
Repeater::make('repeater_1')->schema([
TextInput::make('field_2')->default(fn (Closure $get) => $get('field_1')),
]),
]);
Upvotes: 2
Views: 3677
Reputation: 957
TextInput::make('field_2')->default(fn (Closure $get) => $get('../../field_1')),
https://filamentphp.com/docs/2.x/forms/fields#using-get-to-access-parent-field-values
Upvotes: 6