Skip to content

Commit

Permalink
change array_merge to array_replace to prevent reindex (#45309)
Browse files Browse the repository at this point in the history
Fixes issue where array [506 => null, 'name' => 'kevin'] is reindexed as [0 => null, 'name' => 'kevin']
  • Loading branch information
kevindees committed Dec 14, 2022
1 parent 28bd786 commit 442626c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -1119,7 +1119,7 @@ protected function setClassCastableAttribute($key, $value)
{
$caster = $this->resolveCasterClass($key);

$this->attributes = array_merge(
$this->attributes = array_replace(
$this->attributes,
$this->normalizeCastClassResponse($key, $caster->set(
$this, $key, $value, $this->attributes
Expand Down

0 comments on commit 442626c

Please sign in to comment.