refactor: Update Project/Show component to sort environments by created_at

This commit is contained in:
Andras Bacsai
2024-06-20 14:24:07 +02:00
parent 2421f7c35c
commit 93c890ce41
2 changed files with 5 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ class Show extends Component
{
public Project $project;
public $environments;
public function mount()
{
$projectUuid = request()->route('project_uuid');
@@ -18,7 +20,8 @@ class Show extends Component
if (! $project) {
return redirect()->route('dashboard');
}
$project->load(['environments']);
$this->environments = $project->environments->sortBy('created_at');
$this->project = $project;
}