moving to provider stored in database

This commit is contained in:
2025-04-07 14:38:28 +01:00
parent 6bd12bd6ca
commit b800a9d83a
11 changed files with 100 additions and 14 deletions

View File

@@ -20,7 +20,6 @@ class Server extends Model
protected function casts(): array
{
return [
'provider' => ServerProvider::class,
'status' => ServerStatus::class,
];
}
@@ -66,6 +65,11 @@ class Server extends Model
return $this->hasMany(FirewallRule::class);
}
public function provider(): BelongsTo
{
return $this->belongsTo(Provider::class);
}
public function sshClient(string $user = 'root'): Ssh
{
return Ssh::create($user, $this->ipv4)