project = Project::where('team_id', currentTeam()->id)->where('uuid', $project_uuid)->firstOrFail(); } catch (\Throwable $e) { return handleError($e, $this); } } public function submit() { try { $this->validate(); $environment = Environment::create([ 'name' => $this->name, 'project_id' => $this->project->id, ]); return redirect()->route('project.resource.index', [ 'project_uuid' => $this->project->uuid, 'environment_name' => $environment->name, ]); } catch (\Throwable $e) { handleError($e, $this); } } public function render() { return view('livewire.project.show'); } }