File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ public function toModel()
4141 $ data ['blueprint ' ] = $ this ->blueprint ;
4242 }
4343
44- return $ class ::findOrNew ($ this ->id ())->fill ([
45- 'id ' => $ this ->id (),
44+ $ attributes = [
4645 'origin_id ' => $ this ->origin ()?->id(),
4746 'site ' => $ this ->locale (),
4847 'slug ' => $ this ->slug (),
@@ -54,7 +53,13 @@ public function toModel()
5453 'status ' => $ this ->status (),
5554 'updated_at ' => $ this ->lastModified (),
5655 'order ' => $ this ->order (),
57- ]);
56+ ];
57+
58+ if ($ id = $ this ->id ()) {
59+ $ attributes ['id ' ] = $ id ;
60+ }
61+
62+ return $ class ::findOrNew ($ id )->fill ($ attributes );
5863 }
5964
6065 public function model ($ model = null )
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ public function it_saves_to_entry_model()
4444 'published ' => false ,
4545 'status ' => 'draft ' ,
4646 'origin_id ' => null ,
47- 'id ' => null ,
4847 'order ' => null ,
4948 ]);
5049
You can’t perform that action at this time.
0 commit comments