Added created_by to groups table

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2024-02-28 08:15:59 +00:00
parent 369ecfa490
commit 0bd27d61b0
6 changed files with 53 additions and 1 deletions
+12
View File
@@ -58,6 +58,18 @@ class Group extends SnipeModel
return $this->belongsToMany(\App\Models\User::class, 'users_groups');
}
/**
* Get the user that created the group
*
* @author A. Gianotto <snipe@snipe.net>
* @since [v6.3.0]
* @return \Illuminate\Database\Eloquent\Relations\Relation
*/
public function admin()
{
return $this->belongsTo(\App\Models\User::class, 'created_by');
}
/**
* Decode JSON permissions into array
*