diff --git a/src/controllers/LogViewerController.php b/src/controllers/LogViewerController.php index f4272c0..9dbeaf4 100644 --- a/src/controllers/LogViewerController.php +++ b/src/controllers/LogViewerController.php @@ -67,9 +67,11 @@ public function index() return $data; } - $firstLog = reset($data['logs']); - if (!$firstLog['context'] && !$firstLog['level']) { - $data['standardFormat'] = false; + if (is_array($data['logs'])) { + $firstLog = reset($data['logs']); + if (!$firstLog['context'] && !$firstLog['level']) { + $data['standardFormat'] = false; + } } return app('view')->make('laravel-log-viewer::log', $data);