'array', 'last_seen_at' => 'datetime', ]; protected static function booted(): void { static::creating(fn (self $s) => $s->uuid ??= (string) Str::uuid()); } // R11: URLs address servers by uuid, never the bigint id. public function getRouteKeyName(): string { return 'uuid'; } public function credential(): HasOne { return $this->hasOne(SshCredential::class); } /** * Servers whose stored SSH credential is present AND not disabled — the live poll set. * A disabled ("gesperrt") credential is refused by CredentialVault::resolve() at connect * time, but the poller reuses a long-lived connection, so revocation only takes effect if * the server also drops OUT of this query on the next tick. */ public function scopeWithActiveCredential(Builder $query): void { $query->whereHas('credential', fn (Builder $q) => $q->whereNull('disabled_at')); } }