Skip to content

Commit e23c18d

Browse files
committed
moving remote_disk validation from the service provider to the RemoteLogsRepo
1 parent 003af76 commit e23c18d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Providers/LaravelServiceProvider.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@ class LaravelServiceProvider extends Provider
77
{
88
public function boot()
99
{
10-
$config = config('laravel-log-keeper');
11-
12-
if ($config['enabled']) {
13-
if ($config['enabled_remote'] && !$config['remote_disk']) {
14-
throw new Exception("disk not configured for Laravel Log Keeper");
15-
}
16-
}
10+
//
1711
}
1812

1913
/**

src/Repos/RemoteLogsRepo.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ class RemoteLogsRepo implements LogsRepoInterface
1212

1313
public function __construct(array $config)
1414
{
15-
$this->config = $config;
15+
$this->config = $config;
16+
17+
if ($this->config['enabled_remote'] && !$this->config['remote_disk']) {
18+
throw new Exception("remote_disk not configured for Laravel Log Keeper");
19+
}
20+
1621
$this->localLogPath = storage_path('logs');
1722
$this->disk = Storage::disk($this->config['remote_disk']);
1823
$this->remotePath = $this->config['remote_path'] ? $this->config['remote_path'] . '/' : null;

0 commit comments

Comments
 (0)