Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 5b64f60

Browse files
committed
fix casts
1 parent 769e703 commit 5b64f60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/WithModelMapping.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ trait WithModelMapping
1818
public function mapModelAttributes(?Model $model = null): void
1919
{
2020
if (! is_null($model)) {
21-
collect($model->getAttributes())->each(function ($value, $property) {
21+
collect($model->getAttributes())->each(function ($value, $property) use ($model) {
2222
if (property_exists($this, $property)) {
23-
rescue(fn () => $this->{$property} = $value);
23+
rescue(fn () => $this->{$property} = $model->{$property});
2424
}
2525
});
2626
}

0 commit comments

Comments
 (0)