Multi-db support

This commit is contained in:
Hillel Coren 2017-05-02 22:50:45 +03:00
parent ba90b3bcea
commit eae2fca3a5

View File

@ -73,14 +73,16 @@ class InitLookup extends Command
$this->info($this->log);
if ($this->option('validate') && $errorEmail) {
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 data failed!!');
throw new Exception('Check lookups failed!!');
}
}
}