Skip to content

Commit 08f12a0

Browse files
authored
Don't call Model::toArray() to get attributes for factory insert (#57670)
1 parent 7f98d12 commit 08f12a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Factories/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public function insert(array $attributes = [], ?Model $parent = null): void
471471
$query = $model->newQueryWithoutScopes();
472472

473473
$query->fillAndInsert(
474-
$madeCollection->withoutAppends()->toArray()
474+
$madeCollection->map(fn (Model $model) => $model->getAttributes())->all()
475475
);
476476
}
477477

0 commit comments

Comments
 (0)