diff --git a/src/DcatLogViewerServiceProvider.php b/src/DcatLogViewerServiceProvider.php index 59dd516..55f74ed 100644 --- a/src/DcatLogViewerServiceProvider.php +++ b/src/DcatLogViewerServiceProvider.php @@ -25,8 +25,8 @@ class DcatLogViewerServiceProvider extends ServiceProvider 'middleware' => config('dcat-log-viewer.route.middleware'), ], function ($router) { $router->get('/', ['as' => 'dcat-log-viewer', 'uses' => 'LogController@index',]); + $router->get('download', ['as' => 'dcat-log-viewer.download', 'uses' => 'LogController@download',]); $router->get('{file}', ['as' => 'dcat-log-viewer.file', 'uses' => 'LogController@index',]); - $router->get('download/{file}', ['as' => 'dcat-log-viewer.download', 'uses' => 'LogController@download',]); }); } } diff --git a/src/LogController.php b/src/LogController.php index 3d30420..0555e3a 100644 --- a/src/LogController.php +++ b/src/LogController.php @@ -35,10 +35,11 @@ class LogController ]); } - public function download($file = null) + public function download() { $request = app('request'); + $file = trim($request->get('file')); $dir = trim($request->get('dir')); $filename = trim($request->get('filename')); $keyword = trim($request->get('keyword'));