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.

feat(api): add ownedByCurrentTeamAPI scope to Environment model

Niklas Wichter63008fceb3d7
diff --git a/app/Models/Environment.php b/app/Models/Environment.php
index d4e614e6ee..ae027a5858 100644
--- a/app/Models/Environment.php
+++ b/app/Models/Environment.php
@@ -42,6 +42,11 @@ class Environment extends BaseModel
return Environment::whereRelation('project.team', 'id', currentTeam()->id)->orderBy('name');
}
+ public static function ownedByCurrentTeamAPI(int $teamId)
+ {
+ return Environment::whereRelation('project.team', 'id', $teamId)->orderBy('name');
+ }
+
public function isEmpty()
{
return $this->applications()->count() == 0 &&