added account events
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Jobs\Banking;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Events\Banking\AccountCreating;
|
||||
use App\Events\Banking\AccountCreated;
|
||||
use App\Interfaces\Job\HasOwner;
|
||||
use App\Interfaces\Job\HasSource;
|
||||
use App\Interfaces\Job\ShouldCreate;
|
||||
@@ -12,6 +14,8 @@ class CreateAccount extends Job implements HasOwner, HasSource, ShouldCreate
|
||||
{
|
||||
public function handle(): Account
|
||||
{
|
||||
event(new AccountCreating($this->request));
|
||||
|
||||
\DB::transaction(function () {
|
||||
$this->model = Account::create($this->request->all());
|
||||
|
||||
@@ -22,6 +26,8 @@ class CreateAccount extends Job implements HasOwner, HasSource, ShouldCreate
|
||||
}
|
||||
});
|
||||
|
||||
event(new AccountCreated($this->model, $this->request));
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user