Setting up a stream seems like an inferior option in an already performance intensive operation.
For people looking into this issue, a possible (yet inferior solution) is:
\Phpdocx\Create\CreateDocx::$returnDocxStructure = true;
$queue = array();
$docx = new \Phpdocx\Create\CreateDocxFromTemplate('/path_to.docx');
$queue[] = $docx->createDocx();
\Phpdocx\Create\CreateDocx::$returnDocxStructure = false;
\Phpdocx\Create\CreateDocx::$streamMode = true;
$merge = new \Phpdocx\Utilities\MultiMerge();
$merge->mergeDocx($queue[0], array(), 'example.docx', array());
return response()->noContent();
IMHO this is inferior, because the stream is already started by $merge->mergeDocx($queue[0], array(), 'example.docx', array()). The last return statement is just there to ensure that no additional content is captured in PHPDocx's stream. This does the trick, but seems like a bit of a dirty solution to me.
Why not output your PhpDocx stream along the lines of Symfony\Component\HttpFoundation\StreamedResponse? As argued before, this Symfony component is becoming a widely accepted component in other frameworks and CMS as well.
In any case, hope this helps some people looking into the same issue. Meanwhile, I am looking forward to the updated documentation. Could you please drop a line here once it becomes available?