Code Duplication    Length = 6-8 lines in 2 locations

src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php 2 locations

@@ 61-68 (lines=8) @@
58
            $this->folder = $folder;
59
        }
60
        if(is_array($this->storage_path)) {
61
            foreach ($this->storage_path as $value) {
62
                $logsPath = $value . '/' . $folder;
63
                if (app('files')->exists($logsPath)) {
64
                    $this->folder = $folder;
65
                    break;
66
                }
67
            }
68
        } else {
69
            if ($this->storage_path) {
70
                $logsPath = $this->storage_path . '/' . $folder;
71
                if (app('files')->exists($logsPath)) {
@@ 103-108 (lines=6) @@
100
            return $file;
101
        }
102
        if (is_array($this->storage_path)) {
103
            foreach ($this->storage_path as $folder) {
104
                if (app('files')->exists($folder . '/' . $file)) { // try the absolute path
105
                    $file = $folder . '/' . $file;
106
                    break;
107
                }
108
            }
109
            return $file;
110
        }
111