Skip to content

Commit 2b395cd

Browse files
committed
fix casting
1 parent 7ab5b4b commit 2b395cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,9 +1364,12 @@ public function originalIsEquivalent($key)
13641364
} elseif ($this->isDateAttribute($key)) {
13651365
return $this->fromDateTime($attribute) ===
13661366
$this->fromDateTime($original);
1367-
} elseif ($this->hasCast($key, static::$primitiveCastTypes)) {
1367+
} elseif ($this->hasCast($key, ['object', 'collection'])) {
13681368
return $this->castAttribute($key, $attribute) ==
13691369
$this->castAttribute($key, $original);
1370+
} elseif ($this->hasCast($key, static::$primitiveCastTypes)) {
1371+
return $this->castAttribute($key, $attribute) ===
1372+
$this->castAttribute($key, $original);
13701373
}
13711374

13721375
return is_numeric($attribute) && is_numeric($original)

0 commit comments

Comments
 (0)