Repeater and pivot table
Hi, I'm facing an issue with Repeater and a BelongsToMany Relationship.
Here's my Project model :
My pivot table, called "project_user", has a "project_role" column.
Then I have in my EditProject (App\Filament\Resources\ProjectResource\Pages\EditProject) the following Repeater :
I'd like the "project_role" select to automatically fill this pivot column, however it does not work, it tries to fill my "users" table.
Any idea?
3 Replies
The only solution I found was to create a hasMany relationship with the pivot table explicitly in the Project Model
Yes, that's it. The question comes up regularly in the chat.
Thanks π