invalidateAiSummary(); $this->dispatchFaviconFetchIfNeeded($company); } public function created(Company $company): void { if ($company->creation_source === CreationSource::API) { new NotifyTeamOfNewApiLead()->execute($company); } } private function dispatchFaviconFetchIfNeeded(Company $company): void { $domainField = $company->customFields() ->whereBelongsTo($company->team) ->where('code', CompanyField::DOMAINS->value) ->first(); if ($domainField === null) { return; } $company->load('customFieldValues.customField.options'); $domains = $company->getCustomFieldValue($domainField); $firstDomain = is_array($domains) ? ($domains[0] ?? null) : $domains; if (blank($firstDomain)) { return; } dispatch(new FetchFaviconForCompany($company))->afterCommit(); } }