Skip to content

Commit

Permalink
Merge pull request #80 from elghobaty/master
Browse files Browse the repository at this point in the history
Use "redirect" helper function to support Lumen's Redirector.
  • Loading branch information
rap2hpoutre authored Nov 24, 2016
2 parents cf1d2d3 + bdd4790 commit 03d5cb9
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 03d5cb9

Please sign in to comment.