Skip to content

Commit 7f451d3

Browse files
author
Admin
committed
Fix Model offsetUnset laravel/framework#56335
1 parent cdefc61 commit 7f451d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

illuminate/Database/Eloquent/Model.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,12 @@ public function offsetSet($offset, $value): void
23122312
*/
23132313
public function offsetUnset($offset): void
23142314
{
2315-
unset($this->attributes[$offset], $this->relations[$offset]);
2315+
unset(
2316+
$this->attributes[$offset],
2317+
$this->relations[$offset],
2318+
$this->attributeCastCache[$offset],
2319+
$this->classCastCache[$offset]
2320+
);
23162321
}
23172322

23182323
/**

0 commit comments

Comments
 (0)