'boolean', 'port' => 'integer', ]; } public function connectionKey(): string { return 'dbconn_' . $this->id; } public function getPassword(): string { try { return Crypt::decryptString($this->password_encrypted); } catch (\Throwable) { return ''; } } public function setPassword(string $password): void { $this->password_encrypted = Crypt::encryptString($password); } public function driverLabel(): string { return match ($this->driver) { 'sqlsrv' => 'SQL Server', 'pgsql' => 'PostgreSQL', 'mysql' => 'MySQL', 'mariadb' => 'MariaDB', default => strtoupper($this->driver), }; } public function defaultPort(): int { return match ($this->driver) { 'sqlsrv' => 1433, 'pgsql' => 5432, 'mysql', 'mariadb' => 3306, default => $this->port, }; } }