Hello,
UPDATE: phpdocx 12 added the parseLineBreaks option to the addText method.
If you are using the addText method and you want to add a line break for each \n, the only solution would be to use the explode function of PHP to generate an array for each \n and then iterate it to add as many lines as needed with addText:
$texts = explode('\n', $var);
foreach ($texts as $text) {
$docx->addText($text);
}
If you are using a template and methods such as replaceVariableByText (https://www.phpdocx.com/api-documentation/templates/replace-variable-text-Word-document), you can use the parseLineBreaks option to replace \n by a line break automatically.
Regards.