company->db); if($this->company->account->isFreeHostedClient() || $this->client->country_id != 840) { return; } $tax_provider = new \App\Services\Tax\Providers\TaxProvider($this->company, $this->client); try { $tax_provider->updateClientTaxData(); if (!$this->client->state && $this->client->postal_code) { $this->client->update(['state' => USStates::getState($this->client->postal_code)]); // $this->client->saveQuietly(); } } catch(\Exception $e) { nlog("Exception:: UpdateTaxData::" . $e->getMessage()); nlog("problem getting tax data => ".$e->getMessage()); } } public function middleware() { return [new WithoutOverlapping($this->client->id.$this->company->id)]; } public function failed($exception) { nlog("UpdateTaxData failed => ".$exception->getMessage()); config(['queue.failed.driver' => null]); } }