How to display and update pivot field in attach/edit form?
I've got a table, Places, that has a name and a description fields among other, and it's linked to an Itinerary table through a pivot, Itinerary_Place.
This pivot table also has both name and description, so I can override the default ones when attaching a place to an itinerary.
I can't find a way to display AND update the pivot name/description though, I can either display it by using
make('pivot_name')
but then it fails when it's time to save, or I can use make('name')
and it'll update the correct field in the pivot table but it will always display the place's original name (same goes for the description)
What am I missing?2 Replies
I recently did this for a project. I had a
jobs
table and a job_user
table with a task on the job_user
table.
Here's what my relation manager looked like:
On the form I used task
but on the table I used pivot.task
But what does it display in the form when you try to edit it? I'm using the same setup but when it comes to editing it shows the non-pivot value (even though it saves in the correct pivot table)
Here's my actual code
i'm skipping the table part, which works perfectly as all it do is attaching