Answer the question
In order to leave comments, you need to log in
How to get many Many-to-Many relationships through one pivot table?
There is a table for linking product properties and their values.
public function features()
{
return DB::table('feature_product_pivot')
->leftJoin('features', 'feature_product_pivot.feature_id',
'=', 'features.id')
->leftJoin('feature_values', 'feature_product_pivot.value_id',
'=', 'feature_values.id')
->leftJoin('feature_units', 'feature_product_pivot.unit_id',
'=', 'feature_units.id')
->where('product_id', $this->id)
->get();
}
Answer the question
In order to leave comments, you need to log in
No join needed. Open the documentation and read how to use links.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question