team_id); $temp_file = 'id.rsa_' . 'root' . '@' . $server->ip; Storage::disk('local')->put($temp_file, $server->privateKey->private_key, 'private'); $private_key_location = '/var/www/html/storage/app/' . $temp_file; return resolve(DispatchRemoteProcess::class, [ 'remoteProcessArgs' => new RemoteProcessArgs( model: $model, server_ip: $server->ip, deployment_uuid: $deployment_uuid, private_key_location: $private_key_location, command: <<port, user: $server->user, ), ])(); } function checkTeam(string $team_id) { $found_team = auth()->user()->teams->pluck('id')->contains($team_id); if (!$found_team) { throw new \RuntimeException('You do not have access to this server.'); } } }