I'm trying to generate a XML file using Laravel. Starting from the Controller, where I generate the data that I need to use on the XML file. I generate the XML file using a blade template but I can't save the file or download it automatically
$xml_datos = [];
$total = 0;
.
.
.
$output = View::make('site.contabilidad.adeudosXML')->with(compact('xml_datos', 'total'))->render();
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \n <Document xmlns=\"urn:iso:std:iso:20022:tech:xsd:pain.008.001.02\">" .$output;
return $xml;
I need the file to be downloaded, not showed. I've tried using the class Storage and Filesystem but none of them seems to work