File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public function delete(int $id): mixed;
5959
6060 public function deleteWhere (array $ where ): ?bool ;
6161
62+ public function massDelete (): ?bool ;
63+
6264 public function forceDelete (int $ id ): mixed ;
6365
6466 public function restore (int $ id ): mixed ;
Original file line number Diff line number Diff line change @@ -366,6 +366,19 @@ public function deleteWhere(array $where): ?bool
366366 return $ deleted ;
367367 }
368368
369+ public function massDelete (): ?bool
370+ {
371+ $ this ->applyScope ();
372+
373+ $ deleted = $ this ->model ->delete ();
374+
375+ event (new RepositoryEntityDeleted ($ this , $ this ->model ->getModel ()));
376+
377+ $ this ->resetModel ();
378+
379+ return $ deleted ;
380+ }
381+
369382 public function forceDelete (int $ id ): mixed
370383 {
371384 return $ this ->manageDeletes ($ id , 'forceDelete ' );
You can’t perform that action at this time.
0 commit comments