Skip to content

Commit 1b99d00

Browse files
authored
Merge pull request #23 from praveenyadv/praveenyadv-patch-1
Add default array if config file doesn't exist
2 parents a145455 + 835d951 commit 1b99d00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LogToDB.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LogToDB
4949
function __construct($loggingConfig = [])
5050
{
5151
//Log default config if present
52-
$this->config = $loggingConfig + config('logtodb');
52+
$this->config = $loggingConfig + (config('logtodb') ?? []);
5353
$this->collection = $this->config['collection'] ?? 'log';
5454
$this->model = $this->config['model'] ?? null;
5555

@@ -237,4 +237,4 @@ private function parseIfException($context)
237237
return $context;
238238
}
239239

240-
}
240+
}

0 commit comments

Comments
 (0)