akaunting 3.0 (the last dance)
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
namespace App\Jobs\Auth;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Events\Auth\UserDeleted;
|
||||
use App\Events\Auth\UserDeleting;
|
||||
use App\Interfaces\Job\ShouldDelete;
|
||||
|
||||
class DeleteUser extends Job implements ShouldDelete
|
||||
@ -11,12 +13,16 @@ class DeleteUser extends Job implements ShouldDelete
|
||||
{
|
||||
$this->authorize();
|
||||
|
||||
event(new UserDeleting($this->model));
|
||||
|
||||
\DB::transaction(function () {
|
||||
$this->model->delete();
|
||||
|
||||
$this->model->flushCache();
|
||||
});
|
||||
|
||||
event(new UserDeleted($this->model));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user