modalId = new Cuid2(7); $parameters = get_route_parameters(); $this->projectUuid = $parameters['project_uuid']; $this->environmentName = $parameters['environment_name']; } public function delete() { try { $this->resource->delete(); DeleteResourceJob::dispatch($this->resource); return redirect()->route('project.resource.index', [ 'project_uuid' => $this->projectUuid, 'environment_name' => $this->environmentName ]); } catch (\Throwable $e) { return handleError($e, $this); } } }