Repeater BelongsToMany not working on edit form
i followed the steps from the docs: https://filamentphp.com/docs/3.x/forms/fields/repeater#integrating-with-a-belongstomany-eloquent-relationship
This works on creation, but on the edit form it only shows a single record, not all the items.
On the Client Resource:
ClientLocation Pivot model has:
Also when I submit the edit page and change the single record it shows, it gives an error:
5 Replies
For future reference:
My newly created Pivot Model didnt have an ID column. This is required. So if you run in to this problem and your pivot table doesnt have an id column. Add it ❤️
adding it where exactly? i though id exists automatically,
What is your table structure?
Order table, Device table, custom DeviceOrder pivot model with id, order_id, device_id, quantity.
you should use BelongsToMany relationship i think