diff --git a/app/Jobs/Util/SystemLogger.php b/app/Jobs/Util/SystemLogger.php index 3891350b21..77e4cb031d 100644 --- a/app/Jobs/Util/SystemLogger.php +++ b/app/Jobs/Util/SystemLogger.php @@ -44,16 +44,19 @@ class SystemLogger implements ShouldQueue $this->event_id = $event_id; $this->type_id = $type_id; $this->client = $client; + $this->company = $company; } public function handle() :void { + if(!$this->company) + return; MultiDB::setDb($this->company->db); $client_id = $this->client ? $this->client->id : null; $user_id = $this->client ? $this->client->user_id : $this->company->owner()->id; - + $sl = [ 'client_id' => $client_id, 'company_id' => $this->company->id,