Level 2
did you found a way to fix it ??
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have this relationship.
public function articles(): BelongsToMany
{
return $this->belongsToMany(Article::class, 'group_article')->using(GroupArticle::class)->withPivot('formula', 'rounding_rule', 'precision');
}
public function publicArticles(): BelongsToMany
{
return $this->belongsToMany(Article::class, 'group_article')->as('articles')->using(GroupArticle::class)->withPivot('rounding_rule', 'precision');
}
I have tried to add publicArticles relationship to retrieve only 2 additionnal pivot datas instead of 3 ones.
I also have tried to add withPivot() in the query inside ->load(), but it doesn't work, I always retrieve the 3 additional pivot datas.
How can I do to retrieve only 2 pivot datas ?
Thanks for your help.
V
Yes it's solved. In fact I work with 2 different relationships and it works fine.
Please or to participate in this conversation.