From 431c404ab8eee02a7f7097500d1ae80c08d750fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Serra?= Date: Thu, 8 Mar 2018 11:39:31 +0000 Subject: [PATCH 1/3] Make package work across Laravel 5.x installations --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 94b5804..dd29738 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ ], "require": { "php": ">=7.0.0", - "laravel/framework": "5.5.*", - "encore/laravel-admin": "1.5.*" + "laravel/framework": "~5.5", + "encore/laravel-admin": "~1.5" }, "require-dev": { "phpunit/phpunit": "~6.0", From f8da059546102b309e08730214f1aaab7036f445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Serra?= Date: Thu, 8 Mar 2018 11:51:20 +0000 Subject: [PATCH 2/3] Fix Controller when no File has been defined to automatically resolve to last modified file --- src/BootExtension.php | 2 +- src/LogController.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/BootExtension.php b/src/BootExtension.php index 1289c01..3509bc2 100644 --- a/src/BootExtension.php +++ b/src/BootExtension.php @@ -36,7 +36,7 @@ protected static function registerRoutes() */ public static function import() { - parent::createMenu('Log viwer', 'logs', 'fa-database'); + parent::createMenu('Log Viewer', 'logs', 'fa-database'); parent::createPermission('Logs', 'ext.log-viewer', 'logs*'); } diff --git a/src/LogController.php b/src/LogController.php index fc78b7d..ce99672 100644 --- a/src/LogController.php +++ b/src/LogController.php @@ -9,8 +9,12 @@ class LogController extends Controller { - public function index($file, Request $request) + public function index($file = null, Request $request) { + if($file === null) { + $file = (new LogViewer())->getLastModifiedLog(); + } + return Admin::content(function (Content $content) use ($file, $request) { $offset = $request->get('offset'); From 263aceeab2eeb1185d7fadd44e6c51fab2812444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Serra?= Date: Thu, 8 Mar 2018 11:54:48 +0000 Subject: [PATCH 3/3] StyleCI fixes --- src/LogController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LogController.php b/src/LogController.php index ce99672..3f6e925 100644 --- a/src/LogController.php +++ b/src/LogController.php @@ -11,7 +11,7 @@ class LogController extends Controller { public function index($file = null, Request $request) { - if($file === null) { + if ($file === null) { $file = (new LogViewer())->getLastModifiedLog(); }