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.

refactor: Update PrivateKey model to use ownedByCurrentTeam() scope for cleanupUnusedKeys()

Andras Bacsai760cf8aeb538
diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php
index 48273a9f89..065746edee 100644
--- a/app/Models/PrivateKey.php
+++ b/app/Models/PrivateKey.php
@@ -229,7 +229,7 @@ class PrivateKey extends BaseModel
public static function cleanupUnusedKeys()
{
- self::all()->each(function ($privateKey) {
+ self::ownedByCurrentTeam()->each(function ($privateKey) {
$privateKey->safeDelete();
});
}