add document deleting and document deleted events
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Jobs\Document;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Events\Document\DocumentDeleted;
|
||||
use App\Events\Document\DocumentDeleting;
|
||||
use App\Interfaces\Job\ShouldDelete;
|
||||
use App\Observers\Transaction;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -13,6 +15,8 @@ class DeleteDocument extends Job implements ShouldDelete
|
||||
{
|
||||
$this->authorize();
|
||||
|
||||
event(new DocumentDeleting($this->model));
|
||||
|
||||
\DB::transaction(function () {
|
||||
Transaction::mute();
|
||||
|
||||
@@ -25,6 +29,8 @@ class DeleteDocument extends Job implements ShouldDelete
|
||||
Transaction::unmute();
|
||||
});
|
||||
|
||||
event(new DocumentDeleted($this->model));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user