mirror of
https://github.com/tiennm99/coolify.git
synced 2026-05-13 16:58:10 +00:00
improved hetzner features
This commit is contained in:
@@ -17,6 +17,16 @@ class CloudProviderToken extends Model
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
|
||||
public function servers()
|
||||
{
|
||||
return $this->hasMany(Server::class);
|
||||
}
|
||||
|
||||
public function hasServers(): bool
|
||||
{
|
||||
return $this->servers()->exists();
|
||||
}
|
||||
|
||||
public static function ownedByCurrentTeam(array $select = ['*'])
|
||||
{
|
||||
$selectArray = collect($select)->concat(['id']);
|
||||
|
||||
@@ -161,6 +161,7 @@ class Server extends BaseModel
|
||||
'user',
|
||||
'description',
|
||||
'private_key_id',
|
||||
'cloud_provider_token_id',
|
||||
'team_id',
|
||||
'hetzner_server_id',
|
||||
];
|
||||
@@ -890,6 +891,11 @@ $schema://$host {
|
||||
return $this->belongsTo(PrivateKey::class);
|
||||
}
|
||||
|
||||
public function cloudProviderToken()
|
||||
{
|
||||
return $this->belongsTo(CloudProviderToken::class);
|
||||
}
|
||||
|
||||
public function muxFilename()
|
||||
{
|
||||
return 'mux_'.$this->uuid;
|
||||
|
||||
Reference in New Issue
Block a user