diff --git a/app/Jobs/Common/CreateContact.php b/app/Jobs/Common/CreateContact.php index bad83ef9a..4edbf789e 100644 --- a/app/Jobs/Common/CreateContact.php +++ b/app/Jobs/Common/CreateContact.php @@ -43,17 +43,17 @@ class CreateContact extends Job implements HasOwner, HasSource, ShouldCreate throw new \Exception($message); } - $customer_role = Role::all()->filter(function ($role) { + $customer_role_id = Role::all()->filter(function ($role) { return $role->hasPermission('read-client-portal'); - })->pluck('id')->toArray(); + })->pluck('id')->first(); $this->request->merge([ 'locale' => setting('default.locale', 'en-GB'), - 'roles' => $customer_role, + 'roles' => $customer_role_id, 'companies' => [$this->request->get('company_id')], ]); - $user = $this->dispatch(new CreateUser($this->request)); + $user = $this->dispatch(new ($this->request)); $this->request['user_id'] = $user->id; } diff --git a/app/Jobs/Common/UpdateContact.php b/app/Jobs/Common/UpdateContact.php index cad42419c..9c23466fa 100644 --- a/app/Jobs/Common/UpdateContact.php +++ b/app/Jobs/Common/UpdateContact.php @@ -57,13 +57,13 @@ class UpdateContact extends Job implements ShouldUpdate throw new \Exception($message); } - $customer_role = Role::all()->filter(function ($role) { + $customer_role_id = Role::all()->filter(function ($role) { return $role->hasPermission('read-client-portal'); - })->pluck('id')->toArray(); + })->pluck('id')->first(); $this->request->merge([ 'locale' => setting('default.locale', 'en-GB'), - 'roles' => $customer_role, + 'roles' => $customer_role_id, 'companies' => [$this->request->get('company_id')], ]);