userId = $userId; $this->companyId = $companyId; } /** * Execute the job. * * @param MegaMindClient $client * @return void */ public function handle(MegaMindClient $client) { // Load the Lighthouse (PBX WSS) configuration from the user's company // settings. This reuses the existing company settings — no new storage. $lighthouse = CompanySettings::get(SettingsHelper::S_PBX_WSS_URL, null, $this->companyId); $port = CompanySettings::get(SettingsHelper::S_PBX_WSS_PORT, null, $this->companyId); // Do not call MegaMind at all unless both the Lighthouse URL and port // are configured for this company. if (empty($lighthouse) || empty($port)) { Log::info('MegaMind: skipping user notification, lighthouse URL/port not configured for company.', [ 'user_id' => $this->userId, 'company_id' => $this->companyId, ]); return; } Log::info('Job: Notifying MegaMind about created user', [ 'user_id' => $this->userId, 'lighthouse' => $lighthouse, 'port' => $port, ]); $client->notifyUserCreated($this->userId, (string) $lighthouse, (int) $port); } }