select('id', 'name', 'uuid')->get(); return response()->json(serializeApiResponse($projects), ); } public function project_by_uuid(Request $request) { $teamId = getTeamIdFromToken(); if (is_null($teamId)) { return invalidTokenResponse(); } $project = Project::whereTeamId($teamId)->whereUuid(request()->uuid)->first()->load(['environments']); if (! $project) { return response()->json(['message' => 'Project not found.'], 404); } return response()->json( serializeApiResponse($project), ); } public function environment_details(Request $request) { $teamId = getTeamIdFromToken(); if (is_null($teamId)) { return invalidTokenResponse(); } $project = Project::whereTeamId($teamId)->whereUuid(request()->uuid)->first(); $environment = $project->environments()->whereName(request()->environment_name)->first(); if (! $environment) { return response()->json(['message' => 'Environment not found.'], 404); } $environment = $environment->load(['applications', 'postgresqls', 'redis', 'mongodbs', 'mysqls', 'mariadbs', 'services']); return response()->json(serializeApiResponse($environment)); } }