diff --git a/PowerTools/PowerToolsController.php b/PowerTools/PowerToolsController.php index 1237b98..9798e99 100755 --- a/PowerTools/PowerToolsController.php +++ b/PowerTools/PowerToolsController.php @@ -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'), ];