FilamentF
Filament11mo ago
br

Infolist Repeatable with custom state

With filamentphp 3 I try to render an entity history using infolist repeatable with text entries for field name, old value and new value. Though I am not able to get my field values shown. It seems like the number of repititions is correct (2). This is my code:

RepeatableEntry::make('mydata')
    ->label('Field Changes')
    ->columnSpanFull()

    ->state([
        //'mydata' => [
            [
                'field_name' => 'a field',
                'old_value' => 'an old value',
                'new_value' => 'a new value',
            ],
            [
                'field_name' => 'another field',
                'old_value' => 'another old value',
                'new_value' => 'another new value',
            ],
        //]
    ])

    ->schema([
        TextEntry::make('field_name'),
        TextEntry::make('old_value'),
        TextEntry::make('new_value'),
    ]),


What is the correct approach to make this work?
Was this page helpful?