From 317d46abea8ee14530d2882938c90073584608b3 Mon Sep 17 00:00:00 2001 From: jqh <841324345@qq.com> Date: Mon, 13 Jul 2020 11:06:51 +0800 Subject: [PATCH] wip download --- resources/view/log.blade.php | 2 +- src/LogController.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/view/log.blade.php b/resources/view/log.blade.php index 764c532..5966050 100644 --- a/resources/view/log.blade.php +++ b/resources/view/log.blade.php @@ -284,7 +284,7 @@
- {{ trans('Download') }} + {{ trans('Download') }} {{-- --}}   diff --git a/src/LogController.php b/src/LogController.php index 0b10d3e..3d30420 100644 --- a/src/LogController.php +++ b/src/LogController.php @@ -37,7 +37,16 @@ class LogController public function download($file = null) { - $viewer = new LogViewer($this->getDirectory(), request('dir'), $file); + $request = app('request'); + + $dir = trim($request->get('dir')); + $filename = trim($request->get('filename')); + $keyword = trim($request->get('keyword')); + + $viewer = new LogViewer($this->getDirectory(), $dir, $file); + + $viewer->setKeyword($keyword); + $viewer->setFilename($filename); return response()->download($viewer->getFilePath()); }