F
Filament10mo ago
ahinkle

Many to Many Associations on Import?

Any ideas on how to use many to many attachment on Imports?
ImportColumn::make('associated_skus')
->label('Associated SKUs')
->requiredMapping()
->rules(['required'])
->fillRecordUsing(function (BigcommerceItem $record, string $value): void {
$associatedSkus = explode(',', $value);
$record->products()->sync($associatedSkus);
}),
ImportColumn::make('associated_skus')
->label('Associated SKUs')
->requiredMapping()
->rules(['required'])
->fillRecordUsing(function (BigcommerceItem $record, string $value): void {
$associatedSkus = explode(',', $value);
$record->products()->sync($associatedSkus);
}),
returns: An attempt was made to evaluate a closure for [Filament\Actions\Imports\ImportColumn], but [$value] was unresolvable.
1 Reply
dormeljon
dormeljon9mo ago
Did you managed to solve it?
Want results from more Discord servers?
Add your server