Level 2
did you found a way to fix it ??
1 like
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
Please or to participate in this conversation.