Replies: 1 comment
-
@Synchro I believe you could use $user->roles()->newPivotQuery()->update(['active' => false]); |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
At present, if you want to update multiple (typically all of them) non-id fields in pivot records, you need to do this:
This is inefficient as it issues a query for every record (a classic N+1). It would be nice to have a method that updates all pivot records in one go, something like this:
Until then we can either live with the overhead, or resort to a manually constructed query.
Beta Was this translation helpful? Give feedback.
All reactions