F
Filament9mo ago
eazy

Nested RepeatableEntry shows duplicate values from first relation

I have a nested RepeatableEntry which always shows the values from the first relation it fetches. This is not correct. My RepeatableEntry:
RepeatableEntry::make('batchItems')
->schema([
Section::make('entry')
->heading(fn(BatchItem $batchItem) => $batchItem->item->name)
->collapsible()
->schema([
RepeatableEntry::make('pallets')
->schema([
TextEntry::make('label'),
])
]),
]),
RepeatableEntry::make('batchItems')
->schema([
Section::make('entry')
->heading(fn(BatchItem $batchItem) => $batchItem->item->name)
->collapsible()
->schema([
RepeatableEntry::make('pallets')
->schema([
TextEntry::make('label'),
])
]),
]),
My query on my resource:
public static function getEloquentQuery(): Builder
{
return Batch::query()
->with([
'batchItems' => [
'item',
'pallets' => [
'location',
'storageRoom',
'storageRoomColumn',
]
],
]);
}
public static function getEloquentQuery(): Builder
{
return Batch::query()
->with([
'batchItems' => [
'item',
'pallets' => [
'location',
'storageRoom',
'storageRoomColumn',
]
],
]);
}
As you can see in the screenshot I always get two pallets with the same values. This is not correct some should have more than 2, less than 2 or no pallets.
No description
1 Reply
EL REKT
EL REKT5mo ago
hallo @eazy , did you solve your problem? I had the same problem, can you share how you solved it? Thank you in advance.