From af7b7664c5eb3008bbdefbcbe5998ee696a1f849 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 10 Jan 2018 20:34:44 -0800 Subject: [PATCH] Added license seat location method --- app/Models/LicenseSeat.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; + + } }