xoshbin
xoshbin
FFilament
Created by xoshbin on 11/21/2024 in #❓┊help
mutateRelationshipDataBeforeCreateUsing in Filament's Repeater supposed to return an array of items?
Isn't the mutateRelationshipDataBeforeCreateUsing callback in Filament's Repeater component supposed to return an array of items (or a list of arrays) instead of a single associative array? Here is my code: ->mutateRelationshipDataBeforeCreateUsing(function (array $data): array { dd($data); $tenant = Filament::getTenant(); foreach ($data as &$item) { $item['organization_id'] = $tenant->id; } return $data; }) When I use dd($data), I expect to see a list of arrays (one for each Repeater item). However, I only see a single associative array containing fields from the first item only. array:7 [▼ // app/Filament/Resources/InvoiceResource.php:244 "product_id" => "3" "quantity" => 4 "unit_price" => 12 ] Shouldn't $data be a list of the Repeater's items rather than the first item's fields? If this is expected behavior, how can I properly manipulate Repeater data at this stage? Could this potentially be a bug?
6 replies