+ 'Content-Disposition' => 'attachment; filename="' . $this->title . '.xml"',
+ 'Content-Transfer-Encoding' => 'UTF-8',
+ ]
+ );
+ }
+
+ /**
+ * Dump a TXT file.
+ *
+ * @return Response
+ */
+ private function produceTxt()
+ {
+ $content = '';
+ $bar = str_repeat('=', 100);
+ foreach ($this->entries as $entry) {
+ $content .= "\n\n" . $bar . "\n\n" . $entry->getTitle() . "\n\n" . $bar . "\n\n";
+ $html = new Html2Text($entry->getContent(), ['do_links' => 'none', 'width' => 100]);
+ $content .= $html->getText();
+ }
+
+ return Response::create(
+ $content,
+ 200,
+ [
+ 'Content-type' => 'text/plain',
+ 'Content-Disposition' => 'attachment; filename="' . $this->title . '.txt"',