A free open source IT asset/license management system
Added adminuser method
snipe6efd323fbf40
diff --git a/app/Models/Location.php b/app/Models/Location.phpindex 9b1ed02f43..a3b047579d 100755--- a/app/Models/Location.php+++ b/app/Models/Location.php@@ -135,6 +135,17 @@ class Location extends SnipeModelreturn $this->hasMany(\App\Models\User::class, 'location_id');}+ /**+ * Establishes the location -> admin user relationship+ *+ * @author A. Gianotto <[email protected]>+ * @return \Illuminate\Database\Eloquent\Relations\Relation+ */+ public function adminuser()+ {+ return $this->belongsTo(\App\Models\User::class, 'created_by');+ }+/*** Find assets with this location as their location_id*diff --git a/app/Models/Supplier.php b/app/Models/Supplier.phpindex e198d10c10..1d667f700e 100755--- a/app/Models/Supplier.php+++ b/app/Models/Supplier.php@@ -128,6 +128,18 @@ class Supplier extends SnipeModelreturn $this->hasMany(\App\Models\Consumable::class, 'supplier_id');}++ /**+ * Establishes the supplier -> admin user relationship+ *+ * @author A. Gianotto <[email protected]>+ * @return \Illuminate\Database\Eloquent\Relations\Relation+ */+ public function adminuser()+ {+ return $this->belongsTo(\App\Models\User::class, 'created_by');+ }+/*** Establishes the supplier -> asset maintenances relationship*