Pivot Table Editing Concept #1994
BenWoodford
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've come across an instance where I want to edit a many-to-many relationship on a model and have pivot values for it (e.g. a custom roles system where users have multiple teams, and a role in each team)
I may well get round to doing this myself but thought I'd post this here in case someone else beats me to it. The idea would be that you'd have the usual
Relation
box to add related models, but rather than entering into a horizontally stacked field, you would add a->layout()
to theRelation
to provide a layout (or list of fields?) to show below the search box for each many-to-many relationship, and I guess their names would be sayteam.users[0].role
,team.users[0].secondAttribute
, etc. So you can then edit each many-to-many pivot value and handle it in the save method by looping through each one accordingly.Beta Was this translation helpful? Give feedback.
All reactions