Hello,
I think you don't need any special name for your problem, in order to solve it, you can make a pivot table with the laravel convention:
author_publisher
With the two IDs of the author and the publisher as FK and the counter as extra pivot column.
So in your model (Author for example, but works also vice versa):
public function publishers()
{
return $this->belongsToMany(Publisher::class)->withPivot('counter');
}
And when you associate the models, you can store the extra pivot data:
$author->publishers()->attach($publisher, ['counter' => $counter]);
Hope it helps!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community