1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/use-the-updateexistingpivot-method-to-make-changes-to-pivot-columns-on-existing-records.md
2022-03-06 19:20:10 +01:00

621 B

title tweet_id thread_slug author_username images created_at slug
Use the updateExistingPivot() method to make changes to pivot columns on existing records 1499806907522961408 weekly-thread-2022-09 mmartin_joo
https://pbs.twimg.com/media/FMsTKxEXIAICDNY.jpg
2022-03-04T18:00:06+00:00 use-the-updateexistingpivot-method-to-make-changes-to-pivot-columns-on-existing-records

💡If you have a many-to-many relationship with a pivot table and extra columns, you can use the updateExistingPivot to update the extra column's value.

In this example, I need to update the status of a given subscriber: