public function run_post(Request $request, $id) { $msg = Utils::output($request); file_put_contents(storage_path("tmp/log" . $id . ".txt"), $msg, FILE_APPEND | LOCK_EX); $client = new \Hoa\Websocket\Client(new \Hoa\Socket\Client('tcp://127.0.0.1:8889')); $client->connect(); $client->send(json_encode(["command" => webSocket::BROADCASTIF, "jobid" => $id, "msg" => $msg])); $client->close(); }