Skip to content

Commit d279a1e

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

illuminate/Database/Eloquent/Model.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,10 @@ public function saveOrFail(array $options = [])
12241224
*/
12251225
protected function finishSave(array $options)
12261226
{
1227-
if ($this->getEventDispatcher()->hasListeners($this::class . '.saved')) {
1227+
if (
1228+
isset($this->tmpDirtyIfAttributesAreSyncedFromCashedCasts)
1229+
&& $this->getEventDispatcher()->hasListeners($this::class . '.saved')
1230+
) {
12281231
$this->tmpDirtyIfAttributesAreSyncedFromCashedCasts = null;
12291232
}
12301233

0 commit comments

Comments
 (0)