Skip to content

Commit

Permalink
Merge pull request #16 from dannyuk1982/patch-3
Browse files Browse the repository at this point in the history
Fixes #15
  • Loading branch information
edalzell authored Jul 18, 2018
2 parents 5f480ad + 4f19d0d commit b0992d8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions PowerTools/PowerToolsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ public function logs()
if (! auth()->check()) {
return redirect('/');
}

$logviewer = new LaravelLogViewer;

if ($file = request('log')) {
LaravelLogViewer::setFile(base64_decode($file));
$logviewer->setFile(base64_decode($file));
}

if ($file = request('dl')) {
return response()->download(LaravelLogViewer::pathToLogFile(base64_decode($file)));
return response()->download($logviewer->pathToLogFile(base64_decode($file)));
}

if ($file = request('del')) {
app('files')->delete(LaravelLogViewer::pathToLogFile(base64_decode($file)));

app('files')->delete($logviewer->pathToLogFile(base64_decode($file)));
return redirect(request()->url());
}

if (request()->has('delall')) {
foreach (LaravelLogViewer::getFiles(true) as $file) {
app('files')->delete(LaravelLogViewer::pathToLogFile($file));
foreach ($logviewer->getFiles(true) as $file) {
app('files')->delete($logviewer->pathToLogFile($file));
}

return redirect(request()->url());
}

$data = [
'logs' => LaravelLogViewer::all(),
'files' => LaravelLogViewer::getFiles(true),
'current_file' => LaravelLogViewer::getFileName(),
'logs' => $logviewer->all(),
'files' => $logviewer->getFiles(true),
'current_file' => $logviewer->getFileName(),
'action_path' => route('logs'),
];

Expand Down

0 comments on commit b0992d8

Please sign in to comment.