diff --git a/app/Jobs/Import/CSVIngest.php b/app/Jobs/Import/CSVIngest.php index 95085ce8682b..b4a264dd323e 100644 --- a/app/Jobs/Import/CSVIngest.php +++ b/app/Jobs/Import/CSVIngest.php @@ -106,6 +106,24 @@ class CSVIngest implements ShouldQueue $new_contact->is_primary = true; $new_contact->save(); } + + Client::with('contacts')->where('company_id', $this->company->id)->cursor()->each(function ($client){ + + $contact = $client->contacts()->first(); + $contact->is_primary = true; + $contact->save(); + + }); + + Vendor::with('contacts')->where('company_id', $this->company->id)->cursor()->each(function ($vendor){ + + $contact = $vendor->contacts()->first(); + $contact->is_primary = true; + $contact->save(); + + }); + + } private function bootEngine()