Default repeater items not working

Hello.
I have an action button on a table to send an email. It opens a form to write the subject and type receivers. I need to fill in two different receivers by default, but it is not working.

Action::make('sendEmailToFactory')->label('')->modalDescription('send email to factory')
      ->form([
          TextInput::make('subject')
              ->label('Email Subject:')
              ->default(fn ($record) => 'Production Order ' . $record->id)
              ->required(),
          TableRepeater::make('emails')
              ->label('Destination emails:')
              ->default([
                  ['email' => 'first@first.com',],
                  ['email' => 'second@second.com',],
                  ])
              ->schema([
                  TextInput::make('email')
                      ->label('Destination email:')
                      ->email()
                      ->required(),
              ])->defaultItems(2)->minItems(1)->addActionLabel('Add more emails'),


Please, any ideas of how to achieve this?
I have tried with Repeater:: and also with TableRepeater::

Tks.
Solution
->modalDescription('send email to factory')
->fillForm([
    'emails' => [
        ['email' => 'first@first.com'],
        ['email' => 'second@second.com'],
    ]
})
Was this page helpful?