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)
338
338
}
339
339
340
340
/**
341
- * Remove all of the event listeners for the model.
341
+ * Remove all the event listeners for the model.
342
342
*
343
343
* @return void
344
344
*/
Original file line number Diff line number Diff line change @@ -448,9 +448,7 @@ public function fill(array $attributes)
448
448
*/
449
449
public function forceFill (array $ attributes )
450
450
{
451
- return static ::unguarded (function () use ($ attributes ) {
452
- return $ this ->fill ($ attributes );
453
- });
451
+ return static ::unguarded (fn () => $ this ->fill ($ attributes ));
454
452
}
455
453
456
454
/**
@@ -987,9 +985,7 @@ public function push()
987
985
*/
988
986
public function saveQuietly (array $ options = [])
989
987
{
990
- return static ::withoutEvents (function () use ($ options ) {
991
- return $ this ->save ($ options );
992
- });
988
+ return static ::withoutEvents (fn () => $ this ->save ($ options ));
993
989
}
994
990
995
991
/**
@@ -1301,6 +1297,16 @@ public function delete()
1301
1297
return true ;
1302
1298
}
1303
1299
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
+
1304
1310
/**
1305
1311
* Delete the model from the database within a transaction.
1306
1312
*
@@ -1627,9 +1633,7 @@ public function replicate(array $except = null)
1627
1633
*/
1628
1634
public function replicateQuietly (array $ except = null )
1629
1635
{
1630
- return static ::withoutEvents (function () use ($ except ) {
1631
- return $ this ->replicate ($ except );
1632
- });
1636
+ return static ::withoutEvents (fn () => $ this ->replicate ($ except ));
1633
1637
}
1634
1638
1635
1639
/**
You can’t perform that action at this time.
0 commit comments