ebrahimimami
Import CSV inside a resource page to save exported data to a relationship table.
As mentioned in official document, the built-in Import feature of Filament, only supports
BelongTo
relationships.
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#importing-relationships
Since your relationship from Order to ProductItem is HasMany
which is noy supported, but fortunately you have the chance to swim against the river's stream 🤓.
Tip: Instead of importing Orders first, Import Order Items first 😉
You can define your importer for ProductionItems, and define some columns with order
relationship of ProductItem
model, which is a BelongsTo
relationship.2 replies