File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
src/Illuminate/Database/Eloquent Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ public static function deleted($callback)
338338 }
339339
340340 /**
341- * Remove all of the event listeners for the model.
341+ * Remove all the event listeners for the model.
342342 *
343343 * @return void
344344 */
Original file line number Diff line number Diff line change @@ -448,9 +448,7 @@ public function fill(array $attributes)
448448 */
449449 public function forceFill (array $ attributes )
450450 {
451- return static ::unguarded (function () use ($ attributes ) {
452- return $ this ->fill ($ attributes );
453- });
451+ return static ::unguarded (fn () => $ this ->fill ($ attributes ));
454452 }
455453
456454 /**
@@ -987,9 +985,7 @@ public function push()
987985 */
988986 public function saveQuietly (array $ options = [])
989987 {
990- return static ::withoutEvents (function () use ($ options ) {
991- return $ this ->save ($ options );
992- });
988+ return static ::withoutEvents (fn () => $ this ->save ($ options ));
993989 }
994990
995991 /**
@@ -1301,6 +1297,16 @@ public function delete()
13011297 return true ;
13021298 }
13031299
1300+ /**
1301+ * Delete the model from the database without raising any events.
1302+ *
1303+ * @return bool
1304+ */
1305+ public function deleteQuietly ()
1306+ {
1307+ return static ::withoutEvents (fn () => $ this ->delete ());
1308+ }
1309+
13041310 /**
13051311 * Delete the model from the database within a transaction.
13061312 *
@@ -1627,9 +1633,7 @@ public function replicate(array $except = null)
16271633 */
16281634 public function replicateQuietly (array $ except = null )
16291635 {
1630- return static ::withoutEvents (function () use ($ except ) {
1631- return $ this ->replicate ($ except );
1632- });
1636+ return static ::withoutEvents (fn () => $ this ->replicate ($ except ));
16331637 }
16341638
16351639 /**
You can’t perform that action at this time.
0 commit comments