From 7456fc1ac70c5b7560d0ee1ea9f14b734a4ff5ac Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 16 Jun 2023 12:05:52 +0200 Subject: [PATCH] fix --- app/Models/PrivateKey.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);