improved hetzner features

This commit is contained in:
Andras Bacsai
2025-10-09 12:53:57 +02:00
parent c9e6418542
commit 704ddf2968
17 changed files with 514 additions and 199 deletions
+10
View File
@@ -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']);
+6
View File
@@ -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;