📅  最后修改于: 2022-03-11 15:00:06.651000             🧑  作者: Mango
public function polyTypeOne()
{
return $this->poly()->where('type','=','1');
}
// usage
$wollies = Woly::with('polyTypeOne')->get();
// pretty much the same as:
$wollies = Woly::with(['poly' => function ($q) {
$q->where('type', 1);
}])->get();