Skip to content

Commit 248efdd

Browse files
author
Pantea Marius-ciclistu
committed
1 parent d279a1e commit 248efdd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,10 +2131,18 @@ public function getDirty()
21312131
$this->tmpDirtyIfAttributesAreSyncedFromCashedCasts;
21322132
}
21332133

2134-
$attributes = [] !== $attributes ? $attributes : \array_keys($this->attributes);
2135-
21362134
$dirty = [];
21372135

2136+
if ([] === $attributes) {
2137+
foreach ($this->getAttributes() as $key => $value) {
2138+
if (!$this->originalIsEquivalent($key)) {
2139+
$dirty[$key] = $value;
2140+
}
2141+
}
2142+
2143+
return $dirty;
2144+
}
2145+
21382146
foreach ($attributes as $key) {
21392147
/** This will call $this->mergeAttributesFromCachedCasts($key) before the if condition */
21402148
$value = $this->getAttributeFromArray($key);

0 commit comments

Comments
 (0)