@@ -3130,7 +3130,7 @@ public function value($column)
3130
3130
{
3131
3131
$ result = (array ) $ this ->first ([$ column ]);
3132
3132
3133
- return count ($ result ) > 0 ? reset ($ result ) : null ;
3133
+ return count ($ result ) > 0 ? array_first ($ result ) : null ;
3134
3134
}
3135
3135
3136
3136
/**
@@ -3142,7 +3142,7 @@ public function rawValue(string $expression, array $bindings = [])
3142
3142
{
3143
3143
$ result = (array ) $ this ->selectRaw ($ expression , $ bindings )->first ();
3144
3144
3145
- return count ($ result ) > 0 ? reset ($ result ) : null ;
3145
+ return count ($ result ) > 0 ? array_first ($ result ) : null ;
3146
3146
}
3147
3147
3148
3148
/**
@@ -3158,7 +3158,7 @@ public function soleValue($column)
3158
3158
{
3159
3159
$ result = (array ) $ this ->sole ([$ column ]);
3160
3160
3161
- return reset ($ result );
3161
+ return array_last ($ result );
3162
3162
}
3163
3163
3164
3164
/**
@@ -3781,7 +3781,7 @@ public function insert(array $values)
3781
3781
return true ;
3782
3782
}
3783
3783
3784
- if (! is_array (reset ($ values ))) {
3784
+ if (! is_array (array_last ($ values ))) {
3785
3785
$ values = [$ values ];
3786
3786
}
3787
3787
@@ -3818,7 +3818,7 @@ public function insertOrIgnore(array $values)
3818
3818
return 0 ;
3819
3819
}
3820
3820
3821
- if (! is_array (reset ($ values ))) {
3821
+ if (! is_array (array_last ($ values ))) {
3822
3822
$ values = [$ values ];
3823
3823
} else {
3824
3824
foreach ($ values as $ key => $ value ) {
@@ -3976,7 +3976,7 @@ public function upsert(array $values, array|string $uniqueBy, ?array $update = n
3976
3976
return (int ) $ this ->insert ($ values );
3977
3977
}
3978
3978
3979
- if (! is_array (reset ($ values ))) {
3979
+ if (! is_array (array_last ($ values ))) {
3980
3980
$ values = [$ values ];
3981
3981
} else {
3982
3982
foreach ($ values as $ key => $ value ) {
@@ -3987,7 +3987,7 @@ public function upsert(array $values, array|string $uniqueBy, ?array $update = n
3987
3987
}
3988
3988
3989
3989
if (is_null ($ update )) {
3990
- $ update = array_keys (reset ($ values ));
3990
+ $ update = array_keys (array_last ($ values ));
3991
3991
}
3992
3992
3993
3993
$ this ->applyBeforeQueryCallbacks ();
0 commit comments