F
Filament9mo ago
Abi

binding an array to a repeatable entry on infolists

I have the following data that is stored as json/array on the model
$data->family = [
"names" => [
"John Doe",
"Jane Doe",
"Justin Doe"
]
];
$data->family = [
"names" => [
"John Doe",
"Jane Doe",
"Justin Doe"
]
];
I am using the infolists and here is the code for it, but I am not sure what is the key I specific for the TextEntry on the RepeatableEntry schema. I cannot manipulate the data in the json as it is retrieved from an API. Any advice?
return $infolist->record($this->data)
->schema([
RepeatableEntry::make('family.names')
->schema([
TextEntry::make('?')
])
])
return $infolist->record($this->data)
->schema([
RepeatableEntry::make('family.names')
->schema([
TextEntry::make('?')
])
])
2 Replies
Jakub
Jakub3mo ago
where u able to get this working?
LeandroFerreira
LeandroFerreira3mo ago
return $infolist
->state([
'data' => [
['name' => fake()->name, 'email' => fake()->email],
['name' => fake()->name, 'email' => fake()->email],
],
])
->schema([
RepeatableEntry::make('data')
->schema([
TextEntry::make('name'),
TextEntry::make('email'),
]),
]);
return $infolist
->state([
'data' => [
['name' => fake()->name, 'email' => fake()->email],
['name' => fake()->name, 'email' => fake()->email],
],
])
->schema([
RepeatableEntry::make('data')
->schema([
TextEntry::make('name'),
TextEntry::make('email'),
]),
]);
@Abi ?
Want results from more Discord servers?
Add your server