From bdd479000d31e61f4c21e5406a6202857eff4334 Mon Sep 17 00:00:00 2001 From: elghobaty Date: Thu, 24 Nov 2016 20:43:53 +0200 Subject: [PATCH] Use "redirect" helper function to support Lumen's Redirector. --- src/controllers/LogViewerController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/controllers/LogViewerController.php b/src/controllers/LogViewerController.php index 6ffcd5e..bb543e1 100644 --- a/src/controllers/LogViewerController.php +++ b/src/controllers/LogViewerController.php @@ -27,7 +27,7 @@ public function index() return Response::download(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('dl')))); } elseif (Request::has('del')) { File::delete(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('del')))); - return Redirect::to(Request::url()); + return $this->redirect(Request::url()); } $logs = LaravelLogViewer::all(); @@ -38,4 +38,13 @@ public function index() 'current_file' => LaravelLogViewer::getFileName() ]); } + + private function redirect($to) + { + if (function_exists('redirect')) { + return redirect($to); + } + + return Redirect::to($to); + } }