Skip to content

Commit

Permalink
Fixing if ->storage_path is array and have Multiple Log View Location…
Browse files Browse the repository at this point in the history
…s folders (#190)

* Fixing if ->storage_path is array and have Multiple Log View Locations folders

* Replace variable from  to
  • Loading branch information
elminson authored and rap2hpoutre committed May 31, 2019
1 parent f6acf97 commit 2f9c1bb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,20 @@ public function setFolder($folder)
if (app('files')->exists($folder)) {
$this->folder = $folder;
}
if ($this->storage_path) {
$logsPath = $this->storage_path . '/' . $folder;
if (app('files')->exists($logsPath)) {
$this->folder = $folder;
if(is_array($this->storage_path)) {
foreach ($this->storage_path as $value) {
$logsPath = $value . '/' . $folder;
if (app('files')->exists($logsPath)) {
$this->folder = $folder;
break;
}
}
} else {
if ($this->storage_path) {
$logsPath = $this->storage_path . '/' . $folder;
if (app('files')->exists($logsPath)) {
$this->folder = $folder;
}
}
}
}
Expand Down

0 comments on commit 2f9c1bb

Please sign in to comment.