Skip to content

Commit 048df3d

Browse files
author
David Nahodyl
committed
changed insert to not use refresh for optimization
1 parent d7177fe commit 048df3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Database/Eloquent/FMModel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ protected function performInsert(Builder $query)
342342
if ($this->getIncrementing()) {
343343
$query->createRecord();
344344
// perform a refresh after the insert to get the generated primary key / ID and calculated data
345-
$this->refresh();
345+
$this->setRawAttributes(
346+
$this->findByRecordId($this->recordId)->attributes
347+
);
346348
}
347349

348350
// If the table isn't incrementing we'll simply insert these attributes as they

0 commit comments

Comments
 (0)