diff --git a/app/Models/LicenseSeat.php b/app/Models/LicenseSeat.php index b1c9a5c3a7..1f1660f90e 100755 --- a/app/Models/LicenseSeat.php +++ b/app/Models/LicenseSeat.php @@ -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; + + } }