From 149303a00047d8779c7204c892f3d77e0d91f050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 29 Jun 2022 14:43:32 +0300 Subject: [PATCH] Contact create use role issue solved.. ( #33k7zvx ) --- app/Jobs/Common/CreateContact.php | 8 ++++---- app/Jobs/Common/UpdateContact.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) 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')], ]);