Skip to content

Commit

Permalink
moving remote_disk validation from the service provider to the Remote…
Browse files Browse the repository at this point in the history
…LogsRepo
  • Loading branch information
mathiasgrimm committed Mar 14, 2016
1 parent 003af76 commit e23c18d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/Providers/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ class LaravelServiceProvider extends Provider
{
public function boot()
{
$config = config('laravel-log-keeper');

if ($config['enabled']) {
if ($config['enabled_remote'] && !$config['remote_disk']) {
throw new Exception("disk not configured for Laravel Log Keeper");
}
}
//
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/Repos/RemoteLogsRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class RemoteLogsRepo implements LogsRepoInterface

public function __construct(array $config)
{
$this->config = $config;
$this->config = $config;

if ($this->config['enabled_remote'] && !$this->config['remote_disk']) {
throw new Exception("remote_disk not configured for Laravel Log Keeper");
}

$this->localLogPath = storage_path('logs');
$this->disk = Storage::disk($this->config['remote_disk']);
$this->remotePath = $this->config['remote_path'] ? $this->config['remote_path'] . '/' : null;
Expand Down

0 comments on commit e23c18d

Please sign in to comment.