TableRepeater / Repeater populating form

Trying to use the TableRepeater plugin and it's working great except I have rows in my database that I want to populate the form with, and I can't seem to get it to do that. I must be missing something. This is an edit modal action on a table row, if that's matters. So the user clicks the table row's edit button, which brings up a modal that should display all the line items of the parent row in the TableRepeater.

    Action::make('customEdit')
                    ->model(AutomatedSalesJournalEntryHeader::class)
                    ->form([
                        TableRepeater::make('lines')
                            ->relationship()
                            ->streamlined()
                            ->headers([
                                Header::make('Account')->width('200px'),
                                Header::make('Debits')->width('100px'),
                                Header::make('Credits')->width('100px'),
                                Header::make('Description')->width('150px'),
                            ])
                            ->schema([
                                Select::make('account_ref_id')
                                    ->required()
                                    ->options(fn() => $this->accounts)
                                TextInput::make('amount')
                                    ->required(),
                                ...
                            ])
                    ]),
Solution
ok, that's helpful. It didn't work with fillFormUsing, but there's a fillForm method and that worked!
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
                        return [
                            'lines' => $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {
                                return [
                                    'account_ref_id' => $line->account_ref_id,
                                    'amount' => $line->amount,
                                    'description' => $line->description,
                                ];
                            })->toArray(),
                        ];
                    })
Was this page helpful?