Skip to content

Commit 579586e

Browse files
committed
Fix laravel 4.2 compatibility
1 parent 9196888 commit 579586e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/controllers/LogViewerController.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function index()
2424
}
2525

2626
if ($this->request->input('dl')) {
27-
return response()->download(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('dl'))));
27+
return $this->download(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('dl'))));
2828
} elseif ($this->request->has('del')) {
2929
app('files')->delete(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('del'))));
3030
return $this->redirect($this->request->url());
@@ -47,4 +47,14 @@ private function redirect($to)
4747

4848
return app('redirect')->to($to);
4949
}
50+
51+
private function download($data)
52+
{
53+
if (function_exists('response')) {
54+
return response()->download($data);
55+
}
56+
57+
// For laravel 4.2
58+
return app('\Illuminate\Support\Facades\Response')->download($data);
59+
}
5060
}

0 commit comments

Comments
 (0)