From 8346c850ca898633ff1a45d4cb2d2c8587a7785d Mon Sep 17 00:00:00 2001 From: Rob Date: Wed, 19 Aug 2015 18:18:11 -0400 Subject: [PATCH] Filter out any directories within the logs folder. --- src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index 4b38736..88dfa42 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -124,12 +124,13 @@ public static function getFiles($basename = false) { $files = glob(storage_path() . '/logs/*'); $files = array_reverse($files); + $files = array_filter($files, 'is_file'); if ($basename && is_array($files)) { foreach ($files as $k => $file) { $files[$k] = basename($file); } } - return $files; + return array_values($files); } /**