Skip to content

Commit

Permalink
Use "redirect" helper function to support Lumen's Redirector.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghobaty committed Nov 24, 2016
1 parent cf1d2d3 commit bdd4790
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/controllers/LogViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand 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);
}
}

0 comments on commit bdd4790

Please sign in to comment.