Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Remove unused code

peaklabs-dev43895419ffbf
diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php
index 79f36ccf85..f2fa9c9cf7 100644
--- a/app/Models/PrivateKey.php
+++ b/app/Models/PrivateKey.php
@@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\ValidationException;
use phpseclib3\Crypt\PublicKeyLoader;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
-use Illuminate\Support\Facades\DB;
#[OA\Schema(
description: 'Private Key model',
@@ -206,22 +205,6 @@ class PrivateKey extends BaseModel
$this->delete();
}
- private static function privateKeyExists($key)
- {
- $publicKey = self::extractPublicKeyFromPrivate($key->private_key);
- if (!$publicKey) {
- return false;
- }
-
- $existingKey = DB::table('private_keys')
- ->where('team_id', $key->team_id)
- ->where('id', '!=', $key->id)
- ->whereRaw('? = (SELECT public_key FROM private_keys WHERE id = private_keys.id)', [$publicKey])
- ->exists();
-
- return $existingKey;
- }
-
public static function generateFingerprint($privateKey)
{
try {