Answer the question
In order to leave comments, you need to log in
How to optimize select query in Laravel5 (many-to-many)?
Hello. There are three tables: Products (id, name), Shops (id, name), Prices (id, price). In communication models
Products
public function price()
{
return $this->belongsToMany('App\Models\Price');
}
public function price()
{
return $this->belongsToMany('App\Models\Price');
}
public function shop()
{
return $this->belongsToMany('App\Models\Shop');
}
public function product()
{
return $this->belongsToMany('App\Models\Product');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question