Repeater pivot
Hi, I'm having a problem with the repeater.
My problem: I've created a pivot table but I don't understand why it doesn't go into the pivot table but into the artist table, so it creates a new artist for me every time I add it, when my aim is for it to register only in my pivot table.
My problem: I've created a pivot table but I don't understand why it doesn't go into the pivot table but into the artist table, so it creates a new artist for me every time I add it, when my aim is for it to register only in my pivot table.
Solution
Did you create a
https://filamentphp.com/docs/3.x/forms/fields/repeater#integrating-with-a-belongstomany-eloquent-relationship
hasMany relationship with the pivot class? Also, there are certain limitations with repeaters - you need a unique ID on the pivot table for them to work property.Please ensure that your pivot model has a primary key column, like id, to allow Filament to keep track of which repeater items have been created, updated and deleted.
https://filamentphp.com/docs/3.x/forms/fields/repeater#integrating-with-a-belongstomany-eloquent-relationship