modalId = new Cuid2(7); $this->parameters = getRouteParameters(); } public function delete() { $destination = $this->resource->destination->getMorphClass()::where('id', $this->resource->destination->id)->first(); instant_remote_process(["docker rm -f {$this->resource->uuid}"], $destination->server); $this->resource->delete(); return redirect()->route('project.resources', [ 'project_uuid' => $this->parameters['project_uuid'], 'environment_name' => $this->parameters['environment_name'] ]); } }