Merge pull request #6569 from turbo124/v5-develop

Update all contact password if multiple contacts have the same email …
This commit is contained in:
David Bomba 2021-09-04 11:54:37 +10:00 committed by GitHub
commit 9df1c0bf02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,8 @@ class ClientContactRepository extends BaseRepository
if (array_key_exists('password', $contact) && strlen($contact['password']) > 1) { if (array_key_exists('password', $contact) && strlen($contact['password']) > 1) {
$update_contact->password = Hash::make($contact['password']); $update_contact->password = Hash::make($contact['password']);
$client->company->client_contacts()->where('email', $update_contact->email)->update(['password' => $update_contact->password]);
} }
$update_contact->save(); $update_contact->save();