added account events

This commit is contained in:
Cihan Şentürk
2023-08-23 11:51:34 +03:00
committed by GitHub
parent fe6b6188b9
commit 271b61808b
9 changed files with 149 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
namespace App\Jobs\Banking;
use App\Abstracts\Job;
use App\Events\Banking\AccountDeleting;
use App\Events\Banking\AccountDeleted;
use App\Interfaces\Job\ShouldDelete;
class DeleteAccount extends Job implements ShouldDelete
@@ -11,10 +13,14 @@ class DeleteAccount extends Job implements ShouldDelete
{
$this->authorize();
event(new AccountDeleting($this->model));
\DB::transaction(function () {
$this->model->delete();
});
event(new AccountDeleted($this->model));
return true;
}