public function exportPlainText($bookSlug, $pageSlug) { $book = $this->bookRepo->getBySlug($bookSlug); $page = $this->pageRepo->getBySlug($pageSlug, $book->id); $containedHtml = $this->exportService->pageToPlainText($page); return response()->make($containedHtml, 200, ['Content-Type' => 'application/octet-stream', 'Content-Disposition' => 'attachment; filename="' . $pageSlug . '.txt']); }