Skip to content

Commit f479ddc

Browse files
authored
fix: missing deleted event dispatcher
1 parent f4cc11d commit f479ddc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Http/Api/Controller.php

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Foundation\Bus\DispatchesJobs;
77
use Phpsa\LaravelApiController\Events\Created;
88
use Phpsa\LaravelApiController\Events\Updated;
9+
use Phpsa\LaravelApiController\Events\Deleted;
910
use Illuminate\Routing\Controller as BaseController;
1011
use Illuminate\Foundation\Validation\ValidatesRequests;
1112
use Phpsa\LaravelApiController\Exceptions\ApiException;
@@ -260,6 +261,7 @@ public function handleDestroyAction($id, $request = null)
260261
$item = $this->builder->whereKey($id)->firstOrFail();
261262
$this->authoriseUserAction('delete', $item);
262263
$item->delete();
264+
event(new Deleted($item, $request));
263265
} catch (ModelNotFoundException $exception) {
264266
return $this->errorNotFound('Record not found');
265267
}

0 commit comments

Comments
 (0)