Ahh I get what you are saying now.
So then the toys relationship with the brand is one-to-many, not many-to-many. There wouldn't be a pivot table in this situation. The toys table has a foreign key that connects to the brand table. There may be duplicates of the name of the toy, but they are different because the brand is different. You could have 2 basketball toys but one is wilson and one is spalding.
toys
| id | name | brand_id
| 1 | Basketball | 1
| 2 | Basketball | 3
brands
| id | name
| 1 | Wilson
| 2 | Fisher Price
| 3 | Spalding
and retrieving would go from
$children = Child::with('toys.brands')->get();
// returns a collection of brands
$brands = $children->pluck('*.toys.*.brands')->unique();
to
$children = Child::with('toys.brand')->get();
// returns a collection of brands
$brands = $children->pluck('*.toys.brand');
and the relationship would be
// toy model
public function brand() {
return $this->belongsTo(Brand::class);
}
// brand model
public function toys() {
return $this->hasMany(Toy::class);
}
It helps to think say it out loud to realize what the relationship is. A brand can have many toys, but a toy can only belong to one brand.