Skip to content

Commit 2f9c1bb

Browse files
elminsonrap2hpoutre
authored andcommitted
Fixing if ->storage_path is array and have Multiple Log View Locations folders (#190)
* Fixing if ->storage_path is array and have Multiple Log View Locations folders * Replace variable from to
1 parent f6acf97 commit 2f9c1bb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,20 @@ public function setFolder($folder)
5757
if (app('files')->exists($folder)) {
5858
$this->folder = $folder;
5959
}
60-
if ($this->storage_path) {
61-
$logsPath = $this->storage_path . '/' . $folder;
62-
if (app('files')->exists($logsPath)) {
63-
$this->folder = $folder;
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)) {
72+
$this->folder = $folder;
73+
}
6474
}
6575
}
6676
}

0 commit comments

Comments
 (0)