Infolist with RepeatableEntry and Array #8753
-
I'm trying to use I didn't find any example on this, unfortunately. Here's my code: public function customerInfolist(Infolist $infolist): Infolist
{
return $infolist
->state([
2 => [
'expected' => 12457,
'booked' => 12457,
],
4 => [
'expected' => 12457,
'booked' => 12457,
],
])
->schema([
RepeatableEntry::make('customers')
->schema([
TextEntry::make('expected')
->label('Expected'),
TextEntry::make('booked')
->label('Booked'),
]),
]
);
} Currently, the infolist outputs nothing. I tried to use Can someone send me a working example or what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The RepeatableEntry is looking for a $infolist
->state([
'customers' => [
[
'id' => 2,
'expected' => 12457,
'booked' => 12457,
],
[
'id' => 4,
'expected' => 12457,
'booked' => 12457,
],
]
])
->schema([
RepeatableEntry::make('customers')
->schema([
TextEntry::make('expected')
->label('Expected'),
TextEntry::make('booked')
->label('Booked'),
]), |
Beta Was this translation helpful? Give feedback.
The RepeatableEntry is looking for a
customers
key in your array. Reshaping your array to this should work.