diff --git a/app/Models/ClientContact.php b/app/Models/ClientContact.php index 7e532178c555..05f1c7392b86 100644 --- a/app/Models/ClientContact.php +++ b/app/Models/ClientContact.php @@ -92,7 +92,7 @@ class ClientContact extends Authenticatable implements HasLocalePreference 'custom_value4', 'email', 'is_primary', - 'client_id', + // 'client_id', ]; /** diff --git a/app/Repositories/ClientContactRepository.php b/app/Repositories/ClientContactRepository.php index 2dd7d7a63b55..e43539e1d657 100644 --- a/app/Repositories/ClientContactRepository.php +++ b/app/Repositories/ClientContactRepository.php @@ -56,8 +56,10 @@ class ClientContactRepository extends BaseRepository if (! $update_contact) { $update_contact = ClientContactFactory::create($client->company_id, $client->user_id); - $update_contact->client_id = $client->id; } + + //10-09-2021 - enforce the client->id and remove client_id from fillables + $update_contact->client_id = $client->id; /* We need to set NULL email addresses to blank strings to pass authentication*/ if(array_key_exists('email', $contact) && is_null($contact['email']))