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); + } }