Laravel Eloquent. I try to intersect two intermediate table. Is there any query more efficient than this?
问题 Laravel Eloquent. I try to intersect two intermediate table. Is there any query more efficient than this ? Unit Model : public function products() { return $this->belongsToMany('App\Product'); } public function users() { return $this->belongsToMany('App\User'); } Product Model : public function units() { return $this->belongsToMany('App\Unit'); } public function users() { return $this->belongsToMany('App\User'); } User Model : public function units() { return $this->belongsToMany('App\Unit');