Filament Repeater: How to Create Multiple Records from a Single Entry?
I'm running into an issue with Filament’s repeater field and could use some help.
My Use Case:
I have a repeater with two fields in each item: one field lets the user select an item (e.g., "Item A") and another field lets them specify a quantity (e.g., 3). My goal is that a single repeater item should ultimately create multiple related records. For example, if a user selects "Item A" with quantity 3, I want to create an array like this:
My Code:
The Problem:
Filament’s callback is designed to return a single associative array per repeater item. Because I'm returning an array of arrays, only the first record is being processed. This results in an error when saving the relationship.
The Error I Received:
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed
How can I resolve this?
0 Replies