2024-01-07 15:23:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Livewire\Project;
|
|
|
|
|
|
|
|
use App\Models\Project;
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class Show extends Component
|
|
|
|
{
|
|
|
|
public Project $project;
|
2024-06-10 20:43:34 +00:00
|
|
|
|
2024-06-20 12:24:07 +00:00
|
|
|
public $environments;
|
|
|
|
|
2024-06-10 20:43:34 +00:00
|
|
|
public function mount()
|
|
|
|
{
|
2024-01-07 15:23:41 +00:00
|
|
|
$projectUuid = request()->route('project_uuid');
|
|
|
|
$teamId = currentTeam()->id;
|
|
|
|
|
|
|
|
$project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
|
2024-06-10 20:43:34 +00:00
|
|
|
if (! $project) {
|
2024-01-07 15:23:41 +00:00
|
|
|
return redirect()->route('dashboard');
|
|
|
|
}
|
2024-06-20 12:24:07 +00:00
|
|
|
|
|
|
|
$this->environments = $project->environments->sortBy('created_at');
|
2024-01-07 15:23:41 +00:00
|
|
|
$this->project = $project;
|
|
|
|
}
|
2024-06-10 20:43:34 +00:00
|
|
|
|
2024-01-07 15:23:41 +00:00
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.project.show');
|
|
|
|
}
|
|
|
|
}
|