fix: enviroments

This commit is contained in:
Andras Bacsai 2023-03-29 13:13:27 +02:00
parent 1c259fe12e
commit 7e47fdf52f
2 changed files with 10 additions and 12 deletions

View File

@ -23,7 +23,8 @@ public function resources()
if (!$project) {
return redirect()->route('home');
}
return view('project.resources', ['project' => $project]);
$environment = $project->environments->where('name', request()->route('environment_name'))->first();
return view('project.resources', ['project' => $project, 'environment' => $environment]);
}
public function application()
{

View File

@ -1,29 +1,26 @@
<x-layout>
<h1>Resources</h1>
@foreach ($project->environments as $environment)
<div>
@foreach ($environment->applications as $application)
<div>
@foreach ($environment->applications as $application)
<p>
<a href="{{ route('project.application', [$project->uuid, $environment->name, $application->uuid]) }}">
{{ $application->name }}
</a>
</p>
@endforeach
@foreach ($environment->databases as $database)
@endforeach
@foreach ($environment->databases as $database)
<p>
<a href="{{ route('project.database', [$project->uuid, $environment->name, $database->uuid]) }}">
{{ $database->name }}
</a>
</p>
@endforeach
@foreach ($environment->services as $service)
@endforeach
@foreach ($environment->services as $service)
<p>
<a href="{{ route('project.service', [$project->uuid, $environment->name, $service->uuid]) }}">
{{ $service->name }}
</a>
</p>
@endforeach
</div>
@endforeach
@endforeach
</div>
</x-layout>