diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php index 732157ccc..2406c25a0 100644 --- a/app/Models/PrivateKey.php +++ b/app/Models/PrivateKey.php @@ -14,10 +14,12 @@ class PrivateKey extends BaseModel protected $hidden = [ 'private_key', ]; - static public function ownedByCurrentTeam() + static public function ownedByCurrentTeam(array $select = ['*']) { - return PrivateKey::whereTeamId(session('currentTeam')->id); + $selectArray = collect($select)->concat(['id']); + return PrivateKey::whereTeamId(session('currentTeam')->id)->where('id', '>', 0)->select($selectArray->all()); } + public function servers() { return $this->hasMany(Server::class);