This commit is contained in:
Andras Bacsai
2023-06-16 12:00:36 +02:00
parent c4c2e81701
commit 8daad8f8b8
12 changed files with 78 additions and 30 deletions

View File

@@ -12,6 +12,10 @@ class GithubApp extends BaseModel
'is_public' => 'boolean',
'type' => 'string'
];
protected $hidden = [
'client_secret',
'webhook_secret',
];
protected static function booted(): void
{
static::deleting(function (GithubApp $github_app) {

View File

@@ -4,6 +4,10 @@ namespace App\Models;
class GitlabApp extends BaseModel
{
protected $hidden = [
'webhook_token',
'app_secret',
];
public function applications()
{
return $this->morphMany(Application::class, 'source');

View File

@@ -11,6 +11,9 @@ class PrivateKey extends BaseModel
'private_key',
'team_id',
];
protected $hidden = [
'private_key',
];
static public function ownedByCurrentTeam()
{
return PrivateKey::whereTeamId(session('currentTeam')->id);

View File

@@ -74,9 +74,10 @@ class Server extends BaseModel
{
return $this->hasOne(ServerSetting::class);
}
static public function ownedByCurrentTeam()
static public function ownedByCurrentTeam(array $select = ['*'])
{
return Server::whereTeamId(session('currentTeam')->id);
$selectArray = collect($select)->concat(['id']);
return Server::whereTeamId(session('currentTeam')->id)->with('settings')->select($selectArray->all());
}
static public function validated()