Load Dokploy project details for compose data
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-29 11:00:53 +01:00
parent dba0cd5882
commit 87f348462b
3 changed files with 45 additions and 7 deletions

View File

@@ -49,6 +49,17 @@ class DokployClient
}, 60);
}
public function project(string $projectId): array
{
return $this->cached($this->projectCacheKey($projectId), function () use ($projectId) {
$project = $this->get('/project.one', [
'projectId' => $projectId,
]);
return is_array($project) ? $project : [];
}, 60);
}
public function findProject(string $projectIdOrName): ?array
{
$projects = $this->projects();
@@ -357,6 +368,11 @@ class DokployClient
return 'dokploy.projects';
}
protected function projectCacheKey(string $projectId): string
{
return "dokploy.project.{$projectId}";
}
protected function forgetApplicationCaches(string $applicationId): void
{
Cache::forget($this->applicationCacheKey($applicationId));