我有這個表,hasManyThrough不工作
categories: id | name | slug
Products: id | name | slug | category_id | brand_id
Brands: id | name | slug |
的問題,當我嘗試在功能的範疇帶到這裏出現的品牌。
分類模式
public function brands()
{
return $this->hasManyThrough('App\Brand', 'App\Product' 'brand_id', 'id');
}
品牌要麼不出現或顯示在錯誤的類別。
是否有其他途徑可以通過品牌產品?