Added user create and update events..

This commit is contained in:
Cüneyt Şentürk
2021-08-15 10:11:54 +03:00
parent 4773fb192d
commit 3b518bda6b
6 changed files with 106 additions and 0 deletions

View File

@ -3,6 +3,8 @@
namespace App\Jobs\Auth;
use App\Abstracts\Job;
use App\Events\Auth\UserCreated;
use App\Events\Auth\UserCreating;
use App\Models\Auth\User;
use Artisan;
@ -29,6 +31,8 @@ class CreateUser extends Job
*/
public function handle()
{
event(new UserCreating($this->request));
\DB::transaction(function () {
$this->user = User::create($this->request->input());
@ -79,6 +83,8 @@ class CreateUser extends Job
}
});
event(new UserCreated($this->user, $this->request));
return $this->user;
}
}