@@ -275,7 +275,7 @@ public function __construct(array $attributes = [])
275
275
*/
276
276
protected function bootIfNotBooted ()
277
277
{
278
- if (!isset (static ::$ booted [static ::class])) {
278
+ if (! isset (static ::$ booted [static ::class])) {
279
279
static ::$ booted [static ::class] = true ;
280
280
281
281
$ this ->fireModelEvent ('booting ' , false );
@@ -324,7 +324,7 @@ protected static function bootTraits()
324
324
foreach (class_uses_recursive ($ class ) as $ trait ) {
325
325
$ method = 'boot ' .class_basename ($ trait );
326
326
327
- if (method_exists ($ class , $ method ) && !in_array ($ method , $ booted )) {
327
+ if (method_exists ($ class , $ method ) && ! in_array ($ method , $ booted )) {
328
328
forward_static_call ([$ class , $ method ]);
329
329
330
330
$ booted [] = $ method ;
@@ -413,7 +413,7 @@ public static function isIgnoringTouch($class = null)
413
413
{
414
414
$ class = $ class ?: static ::class;
415
415
416
- if (!get_class_vars ($ class )['timestamps ' ] || !$ class ::UPDATED_AT ) {
416
+ if (! get_class_vars ($ class )['timestamps ' ] || ! $ class ::UPDATED_AT ) {
417
417
return true ;
418
418
}
419
419
@@ -586,7 +586,7 @@ public function fill(array $attributes)
586
586
*/
587
587
public function forceFill (array $ attributes )
588
588
{
589
- return static ::unguarded (fn () => $ this ->fill ($ attributes ));
589
+ return static ::unguarded (fn () => $ this ->fill ($ attributes ));
590
590
}
591
591
592
592
/**
@@ -746,7 +746,7 @@ public function load($relations)
746
746
*/
747
747
public function loadMorph ($ relation , $ relations )
748
748
{
749
- if (!$ this ->{$ relation }) {
749
+ if (! $ this ->{$ relation }) {
750
750
return $ this ;
751
751
}
752
752
@@ -870,7 +870,7 @@ public function loadExists($relations)
870
870
*/
871
871
public function loadMorphAggregate ($ relation , $ relations , $ column , $ function = null )
872
872
{
873
- if (!$ this ->{$ relation }) {
873
+ if (! $ this ->{$ relation }) {
874
874
return $ this ;
875
875
}
876
876
@@ -982,7 +982,7 @@ protected function decrement($column, $amount = 1, array $extra = [])
982
982
*/
983
983
protected function incrementOrDecrement ($ column , $ amount , $ extra , $ method )
984
984
{
985
- if (!$ this ->exists ) {
985
+ if (! $ this ->exists ) {
986
986
return $ this ->newQueryWithoutRelationships ()->{$ method }($ column , $ amount , $ extra );
987
987
}
988
988
@@ -1000,14 +1000,13 @@ protected function incrementOrDecrement($column, $amount, $extra, $method)
1000
1000
$ amount = (clone $ this )->setAttribute ($ column , $ amount )->getAttributeFromArray ($ column );
1001
1001
}
1002
1002
1003
- return tap ($ this ->setKeysForSaveQuery ($ this ->newQueryWithoutScopes ())->{$ method }($ column , $ amount , $ extra ),
1004
- function () use ($ column ) {
1005
- $ this ->syncChanges ();
1003
+ return tap ($ this ->setKeysForSaveQuery ($ this ->newQueryWithoutScopes ())->{$ method }($ column , $ amount , $ extra ), function () use ($ column ) {
1004
+ $ this ->syncChanges ();
1006
1005
1007
- $ this ->fireModelEvent ('updated ' , false );
1006
+ $ this ->fireModelEvent ('updated ' , false );
1008
1007
1009
- $ this ->syncOriginalAttribute ($ column );
1010
- });
1008
+ $ this ->syncOriginalAttribute ($ column );
1009
+ });
1011
1010
}
1012
1011
1013
1012
/**
@@ -1019,7 +1018,7 @@ function () use ($column) {
1019
1018
*/
1020
1019
public function update (array $ attributes = [], array $ options = [])
1021
1020
{
1022
- if (!$ this ->exists ) {
1021
+ if (! $ this ->exists ) {
1023
1022
return false ;
1024
1023
}
1025
1024
@@ -1037,7 +1036,7 @@ public function update(array $attributes = [], array $options = [])
1037
1036
*/
1038
1037
public function updateOrFail (array $ attributes = [], array $ options = [])
1039
1038
{
1040
- if (!$ this ->exists ) {
1039
+ if (! $ this ->exists ) {
1041
1040
return false ;
1042
1041
}
1043
1042
@@ -1053,7 +1052,7 @@ public function updateOrFail(array $attributes = [], array $options = [])
1053
1052
*/
1054
1053
public function updateQuietly (array $ attributes = [], array $ options = [])
1055
1054
{
1056
- if (!$ this ->exists ) {
1055
+ if (! $ this ->exists ) {
1057
1056
return false ;
1058
1057
}
1059
1058
@@ -1098,7 +1097,7 @@ protected function decrementQuietly($column, $amount = 1, array $extra = [])
1098
1097
public function push ()
1099
1098
{
1100
1099
return $ this ->withoutRecursion (function () {
1101
- if (!$ this ->save ()) {
1100
+ if (! $ this ->save ()) {
1102
1101
return false ;
1103
1102
}
1104
1103
@@ -1110,7 +1109,7 @@ public function push()
1110
1109
? $ models ->all () : [$ models ];
1111
1110
1112
1111
foreach (array_filter ($ models ) as $ model ) {
1113
- if (!$ model ->push ()) {
1112
+ if (! $ model ->push ()) {
1114
1113
return false ;
1115
1114
}
1116
1115
}
@@ -1127,7 +1126,7 @@ public function push()
1127
1126
*/
1128
1127
public function pushQuietly ()
1129
1128
{
1130
- return static ::withoutEvents (fn () => $ this ->push ());
1129
+ return static ::withoutEvents (fn () => $ this ->push ());
1131
1130
}
1132
1131
1133
1132
/**
@@ -1138,7 +1137,7 @@ public function pushQuietly()
1138
1137
*/
1139
1138
public function saveQuietly (array $ options = [])
1140
1139
{
1141
- return static ::withoutEvents (fn () => $ this ->save ($ options ));
1140
+ return static ::withoutEvents (fn () => $ this ->save ($ options ));
1142
1141
}
1143
1142
1144
1143
/**
@@ -1174,7 +1173,7 @@ public function save(array $options = [])
1174
1173
else {
1175
1174
$ saved = $ this ->performInsert ($ query );
1176
1175
1177
- if (!$ this ->getConnectionName () &&
1176
+ if (! $ this ->getConnectionName () &&
1178
1177
$ connection = $ query ->getConnection ()) {
1179
1178
$ this ->setConnection ($ connection ->getName ());
1180
1179
}
@@ -1200,7 +1199,7 @@ public function save(array $options = [])
1200
1199
*/
1201
1200
public function saveOrFail (array $ options = [])
1202
1201
{
1203
- return $ this ->getConnection ()->transaction (fn () => $ this ->save ($ options ));
1202
+ return $ this ->getConnection ()->transaction (fn () => $ this ->save ($ options ));
1204
1203
}
1205
1204
1206
1205
/**
@@ -1429,7 +1428,7 @@ public function delete()
1429
1428
// If the model doesn't exist, there is nothing to delete so we'll just return
1430
1429
// immediately and not do anything else. Otherwise, we will continue with a
1431
1430
// deletion process on the model, firing the proper events, and so forth.
1432
- if (!$ this ->exists ) {
1431
+ if (! $ this ->exists ) {
1433
1432
return ;
1434
1433
}
1435
1434
@@ -1459,7 +1458,7 @@ public function delete()
1459
1458
*/
1460
1459
public function deleteQuietly ()
1461
1460
{
1462
- return static ::withoutEvents (fn () => $ this ->delete ());
1461
+ return static ::withoutEvents (fn () => $ this ->delete ());
1463
1462
}
1464
1463
1465
1464
/**
@@ -1471,11 +1470,11 @@ public function deleteQuietly()
1471
1470
*/
1472
1471
public function deleteOrFail ()
1473
1472
{
1474
- if (!$ this ->exists ) {
1473
+ if (! $ this ->exists ) {
1475
1474
return false ;
1476
1475
}
1477
1476
1478
- return $ this ->getConnection ()->transaction (fn () => $ this ->delete ());
1477
+ return $ this ->getConnection ()->transaction (fn () => $ this ->delete ());
1479
1478
}
1480
1479
1481
1480
/**
@@ -1674,8 +1673,8 @@ public function callNamedScope($scope, array $parameters = [])
1674
1673
public function toArray ()
1675
1674
{
1676
1675
return $ this ->withoutRecursion (
1677
- fn () => array_merge ($ this ->attributesToArray (), $ this ->relationsToArray ()),
1678
- fn () => $ this ->attributesToArray (),
1676
+ fn () => array_merge ($ this ->attributesToArray (), $ this ->relationsToArray ()),
1677
+ fn () => $ this ->attributesToArray (),
1679
1678
);
1680
1679
}
1681
1680
@@ -1716,7 +1715,7 @@ public function jsonSerialize(): mixed
1716
1715
*/
1717
1716
public function fresh ($ with = [])
1718
1717
{
1719
- if (!$ this ->exists ) {
1718
+ if (! $ this ->exists ) {
1720
1719
return ;
1721
1720
}
1722
1721
@@ -1733,7 +1732,7 @@ public function fresh($with = [])
1733
1732
*/
1734
1733
public function refresh ()
1735
1734
{
1736
- if (!$ this ->exists ) {
1735
+ if (! $ this ->exists ) {
1737
1736
return $ this ;
1738
1737
}
1739
1738
@@ -1791,7 +1790,7 @@ public function replicate(?array $except = null)
1791
1790
*/
1792
1791
public function replicateQuietly (?array $ except = null )
1793
1792
{
1794
- return static ::withoutEvents (fn () => $ this ->replicate ($ except ));
1793
+ return static ::withoutEvents (fn () => $ this ->replicate ($ except ));
1795
1794
}
1796
1795
1797
1796
/**
@@ -1802,7 +1801,7 @@ public function replicateQuietly(?array $except = null)
1802
1801
*/
1803
1802
public function is ($ model )
1804
1803
{
1805
- return !is_null ($ model ) &&
1804
+ return ! is_null ($ model ) &&
1806
1805
$ this ->getKey () === $ model ->getKey () &&
1807
1806
$ this ->getTable () === $ model ->getTable () &&
1808
1807
$ this ->getConnectionName () === $ model ->getConnectionName ();
@@ -1816,7 +1815,7 @@ public function is($model)
1816
1815
*/
1817
1816
public function isNot ($ model )
1818
1817
{
1819
- return !$ this ->is ($ model );
1818
+ return ! $ this ->is ($ model );
1820
1819
}
1821
1820
1822
1821
/**
@@ -2027,7 +2026,7 @@ public function getQueueableRelations()
2027
2026
$ relations = [];
2028
2027
2029
2028
foreach ($ this ->getRelations () as $ key => $ relation ) {
2030
- if (!method_exists ($ this , $ key )) {
2029
+ if (! method_exists ($ this , $ key )) {
2031
2030
continue ;
2032
2031
}
2033
2032
0 commit comments