Skip to content

Commit f8da059

Browse files
João SerraJoão Serra
authored andcommitted
Fix Controller when no File has been defined to automatically resolve to last modified file
1 parent 431c404 commit f8da059

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BootExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected static function registerRoutes()
3636
*/
3737
public static function import()
3838
{
39-
parent::createMenu('Log viwer', 'logs', 'fa-database');
39+
parent::createMenu('Log Viewer', 'logs', 'fa-database');
4040

4141
parent::createPermission('Logs', 'ext.log-viewer', 'logs*');
4242
}

src/LogController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99

1010
class LogController extends Controller
1111
{
12-
public function index($file, Request $request)
12+
public function index($file = null, Request $request)
1313
{
14+
if($file === null) {
15+
$file = (new LogViewer())->getLastModifiedLog();
16+
}
17+
1418
return Admin::content(function (Content $content) use ($file, $request) {
1519
$offset = $request->get('offset');
1620

0 commit comments

Comments
 (0)