diff --git a/src/controllers/LogViewerController.php b/src/controllers/LogViewerController.php index 1ef59f3..c6cc417 100644 --- a/src/controllers/LogViewerController.php +++ b/src/controllers/LogViewerController.php @@ -24,7 +24,7 @@ public function index() } if ($this->request->input('dl')) { - return response()->download(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('dl')))); + return $this->download(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('dl')))); } elseif ($this->request->has('del')) { app('files')->delete(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('del')))); return $this->redirect($this->request->url()); @@ -47,4 +47,14 @@ private function redirect($to) return app('redirect')->to($to); } + + private function download($data) + { + if (function_exists('response')) { + return response()->download($data); + } + + // For laravel 4.2 + return app('\Illuminate\Support\Facades\Response')->download($data); + } }