@@ -3130,7 +3130,7 @@ public function value($column)
31303130 {
31313131 $ result = (array ) $ this ->first ([$ column ]);
31323132
3133- return count ($ result ) > 0 ? reset ($ result ) : null ;
3133+ return count ($ result ) > 0 ? array_first ($ result ) : null ;
31343134 }
31353135
31363136 /**
@@ -3142,7 +3142,7 @@ public function rawValue(string $expression, array $bindings = [])
31423142 {
31433143 $ result = (array ) $ this ->selectRaw ($ expression , $ bindings )->first ();
31443144
3145- return count ($ result ) > 0 ? reset ($ result ) : null ;
3145+ return count ($ result ) > 0 ? array_first ($ result ) : null ;
31463146 }
31473147
31483148 /**
@@ -3158,7 +3158,7 @@ public function soleValue($column)
31583158 {
31593159 $ result = (array ) $ this ->sole ([$ column ]);
31603160
3161- return reset ($ result );
3161+ return array_last ($ result );
31623162 }
31633163
31643164 /**
@@ -3781,7 +3781,7 @@ public function insert(array $values)
37813781 return true ;
37823782 }
37833783
3784- if (! is_array (reset ($ values ))) {
3784+ if (! is_array (array_last ($ values ))) {
37853785 $ values = [$ values ];
37863786 }
37873787
@@ -3818,7 +3818,7 @@ public function insertOrIgnore(array $values)
38183818 return 0 ;
38193819 }
38203820
3821- if (! is_array (reset ($ values ))) {
3821+ if (! is_array (array_last ($ values ))) {
38223822 $ values = [$ values ];
38233823 } else {
38243824 foreach ($ values as $ key => $ value ) {
@@ -3976,7 +3976,7 @@ public function upsert(array $values, array|string $uniqueBy, ?array $update = n
39763976 return (int ) $ this ->insert ($ values );
39773977 }
39783978
3979- if (! is_array (reset ($ values ))) {
3979+ if (! is_array (array_last ($ values ))) {
39803980 $ values = [$ values ];
39813981 } else {
39823982 foreach ($ values as $ key => $ value ) {
@@ -3987,7 +3987,7 @@ public function upsert(array $values, array|string $uniqueBy, ?array $update = n
39873987 }
39883988
39893989 if (is_null ($ update )) {
3990- $ update = array_keys (reset ($ values ));
3990+ $ update = array_keys (array_last ($ values ));
39913991 }
39923992
39933993 $ this ->applyBeforeQueryCallbacks ();
0 commit comments