fix: no project redirect

This commit is contained in:
Andras Bacsai 2023-04-12 22:13:17 +02:00
parent 3327e6b584
commit 6fd54561ca

View File

@ -8,10 +8,11 @@ class ProjectController extends Controller
{
public function environments()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first()->load(['environments']);
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
}
$project->load(['environments']);
return view('project.environments', ['project' => $project]);
}