Skip to content

Commit d7bfc91

Browse files
Fix submission is newly created on save (#440)
* Fix submission is newly created on save * Do it on save --------- Co-authored-by: Ryan Mitchell <[email protected]>
1 parent d5798f9 commit d7bfc91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Forms/Submission.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public function save()
8484

8585
$model = $this->toModel();
8686
$model->save();
87-
$isNew = $model->wasRecentlyCreated;
87+
88+
if ($isNew = $model->wasRecentlyCreated) {
89+
$this->id = $model->getKey();
90+
}
8891

8992
$this->model($model->fresh());
9093

0 commit comments

Comments
 (0)