Add 'where' clause to hasManyThrough relationship. (#4276)

This commit is contained in:
Brady Wetherington 2017-10-20 16:58:39 -07:00 committed by snipe
parent abcce78944
commit 189574377a

View file

@ -54,7 +54,7 @@ class Location extends SnipeModel
public function assets()
{
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id');
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id')->where("assets.assigned_type",User::class);
}
public function locationAssets()