Merge remote-tracking branch 'origin/next' into feature/vultr-cloud-provider

This commit is contained in:
Andras Bacsai committed 2026-07-07 21:23:07 +02:00
commit 31f904ef9f
35 files changed
+7215 -113

No files matched your search

+5
View File
@@ -47,6 +47,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 &&
+19
View File
@@ -3,7 +3,19 @@
namespace App\Models;
use App\Traits\HasSafeStringAttribute;
use Illuminate\Support\Facades\DB;
use OpenApi\Attributes as OA;
#[OA\Schema(
description: 'Tag model',
type: 'object',
properties: [
new OA\Property(property: 'uuid', type: 'string'),
new OA\Property(property: 'name', type: 'string'),
new OA\Property(property: 'created_at', type: 'string'),
new OA\Property(property: 'updated_at', type: 'string'),
]
)]
class Tag extends BaseModel
{
use HasSafeStringAttribute;
@@ -23,6 +35,13 @@ class Tag extends BaseModel
return Tag::whereTeamId(currentTeam()->id)->orderBy('name');
}
public function deleteIfOrphaned(): void
{
if (DB::table('taggables')->where('tag_id', $this->id)->doesntExist()) {
$this->delete();
}
}
public function applications()
{
return $this->morphedByMany(Application::class, 'taggable');