artisan way to get attach / sync attributes from Many To Many Relationships #36318
Answered
by
guoxiangke
guoxiangke
asked this question in
Q&A
-
Hi, I have an N:N Relationship, when sync I add some extra attributes. |
Beta Was this translation helpful? Give feedback.
Answered by
guoxiangke
Feb 19, 2021
Replies: 1 comment
-
Got it! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
guoxiangke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got it!
public function roles(): BelongsToMany
{
return $this->belongsToMany()->withPivot(['expires']);
}