Skip to content

Commit

Permalink
refactor: Update Project/Show component to sort environments by creat…
Browse files Browse the repository at this point in the history
…ed_at
  • Loading branch information
andrasbacsai committed Jun 20, 2024
1 parent 2421f7c commit 93c890c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/Livewire/Project/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class Show extends Component
{
public Project $project;

public $environments;

public function mount()
{
$projectUuid = request()->route('project_uuid');
Expand All @@ -18,7 +20,8 @@ public function mount()
if (! $project) {
return redirect()->route('dashboard');
}
$project->load(['environments']);

$this->environments = $project->environments->sortBy('created_at');
$this->project = $project;
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/project/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<div class="text-xs truncate subtitle lg:text-sm">{{ $project->name }}.</div>
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($project->environments as $environment)
@forelse ($environments as $environment)
<div class="gap-2 border border-transparent cursor-pointer box group" x-data
x-on:click="goto('{{ $project->uuid }}','{{ $environment->name }}')">
<div class="flex flex-1 mx-6">
Expand Down

0 comments on commit 93c890c

Please sign in to comment.