mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add 'where' clause to hasManyThrough relationship. (#4276)
This commit is contained in:
parent
abcce78944
commit
189574377a
|
@ -54,7 +54,7 @@ class Location extends SnipeModel
|
||||||
|
|
||||||
public function assets()
|
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()
|
public function locationAssets()
|
||||||
|
|
Loading…
Reference in a new issue