From eae2fca3a5e957d159bb68c590a965174835943a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 2 May 2017 22:50:45 +0300 Subject: [PATCH] Multi-db support --- app/Console/Commands/InitLookup.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/InitLookup.php b/app/Console/Commands/InitLookup.php index 64944f6d47af..acfc9c6b0e70 100644 --- a/app/Console/Commands/InitLookup.php +++ b/app/Console/Commands/InitLookup.php @@ -73,14 +73,16 @@ class InitLookup extends Command $this->info($this->log); - if ($this->option('validate') && $errorEmail) { - Mail::raw($this->log, function ($message) use ($errorEmail, $database) { - $message->to($errorEmail) - ->from(CONTACT_EMAIL) - ->subject("Check-Lookups [{$database}]: " . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE)); - }); - } elseif (! $this->isValid) { - throw new Exception('Check data failed!!'); + if ($this->option('validate')) { + if ($errorEmail = env('ERROR_EMAIL')) { + Mail::raw($this->log, function ($message) use ($errorEmail, $database) { + $message->to($errorEmail) + ->from(CONTACT_EMAIL) + ->subject("Check-Lookups [{$database}]: " . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE)); + }); + } elseif (! $this->isValid) { + throw new Exception('Check lookups failed!!'); + } } }