Added license seat location method

This commit is contained in:
snipe 2018-01-10 20:34:44 -08:00
parent c31362655c
commit af7b7664c5

View file

@ -34,4 +34,17 @@ class LicenseSeat extends Model implements ICompanyableChild
{
return $this->belongsTo('\App\Models\Asset', 'asset_id')->withTrashed();
}
public function location()
{
if (($this->user) && ($this->user->location)) {
return $this->user->location;
} elseif (($this->asset) && ($this->asset->location)) {
return $this->asset->location;
}
return false;
}
}