Use repeatable entry to display a non-database array
I have an array, let's say
$people = [0 => ['name' => 'John', 'age' => 5], 1 => ['name' => 'Carl', 'age' => 10]]
and I would like to use RepeatableEntry to display this data like this
RepeatableEntry::make('people')
->state($people)
->schema([
TextEntry::make('name'),
TextEntry::make('age'),
])
This recognizes the size of the array, but does not find the attributes named in make method. So it just displayes 2 blank rows.
Is there a way to make this work?
0 Replies