From 5e8bcc04dc54545dec57a93a5fa0a45365f4c540 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 21 Aug 2022 09:26:58 +1000 Subject: [PATCH] Update user observer to dispatch a job --- app/Observers/UserObserver.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php index c6bdf94d42..64e7e69bd0 100644 --- a/app/Observers/UserObserver.php +++ b/app/Observers/UserObserver.php @@ -23,8 +23,10 @@ class UserObserver */ public function created(User $user) { - if(class_exists(\Modules\Admin\Jobs\Account\UserQuality::class)) - (new \Modules\Admin\Jobs\Account\UserQuality($user, $user->account->key))->run(); + + if(class_exists(\Modules\Admin\Jobs\Account\UserQuality::class)) + \Modules\Admin\Jobs\Account\UserQuality::dispatch($user, $user->account->key); + } /** @@ -36,8 +38,9 @@ class UserObserver public function updated(User $user) { - if(class_exists(\Modules\Admin\Jobs\Account\UserQuality::class)) - (new \Modules\Admin\Jobs\Account\UserQuality($user, $user->account->key))->run(); + if(class_exists(\Modules\Admin\Jobs\Account\UserQuality::class)) + \Modules\Admin\Jobs\Account\UserQuality::dispatch($user, $user->account->key); + } /**