1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +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

13 lines
No EOL
621 B
Markdown

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