From 90aa0f41a26d30d33b4700fa2821f9cfa7f391b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Fri, 5 Jun 2020 16:04:54 +0300 Subject: [PATCH] delete user of customer --- app/Jobs/Common/DeleteContact.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Jobs/Common/DeleteContact.php b/app/Jobs/Common/DeleteContact.php index c12b8a2e6..3c6a756b0 100644 --- a/app/Jobs/Common/DeleteContact.php +++ b/app/Jobs/Common/DeleteContact.php @@ -3,6 +3,7 @@ namespace App\Jobs\Common; use App\Abstracts\Job; +use App\Jobs\Auth\DeleteUser; use App\Traits\Contacts; class DeleteContact extends Job @@ -30,6 +31,10 @@ class DeleteContact extends Job { $this->authorize(); + if ($user = $this->contact->user) { + $this->dispatch(new DeleteUser($user)); + } + $this->contact->delete(); return true;