added account events
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user