我现在有三个模特
用户
public function languages(){
return $this->belongsToMany('App\Language');
}
报
public function languages(){
return $this->belongsToMany('App\Language');
}
语言
public function users(){
return $this->belongsToMany('App\User');
}
public function newspapers(){
return $this->belongsToMany('App\Newspaper');
}
我已经拥有language_user
,language_newspaper
表格
在修补程序中,我已成功通过attach()blablabla检索这两种关系。
问题是
我怎样才能在{1}} {1}}中搜索Newspaper
id1具有此User
的啰嗦?对我来说这似乎很复杂。
Language
User id1 -> has language en, zh
- >确定
Newspaper id1 -> has language en, jp
- >不行
我试过这个,但不确定它是否正确
Newspaper id2 -> has language zh
$where = [];
答案 0 :(得分:1)
您应该能够在此方案中使用-targetargs:"tests.dll /exclude:PerfomanceTests"
,如下所示:
whereHas