Esta es la parte del controlador, en el cual llamo la librería he intento generar el archivo de word, pero no lo he logrado.Ayuda por favor, gracias!!!
public function index(){ require("third_party/PhpWord/PhpWord.php"); require("third_party/PhpWord/Autoloader.php"); try { $phpWord = new PhpWord(); $section = $phpWord->addSection(); $section->addText('Hello World'); $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); header("Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document"); header("Content-Disposition: attachment; filename='myFile.docx'"); $objWriter->save('php://output'); } catch (Exception $e) { echo $e->getMessage(); }}