File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public static function fromModel(Model $model)
1717 ->date ($ model ->date )
1818 ->collection ($ model ->collection )
1919 ->data ($ model ->data )
20+ ->blueprint ($ model ->data ['blueprint ' ] ?? null )
2021 ->published ($ model ->published )
2122 ->model ($ model );
2223 }
@@ -25,6 +26,12 @@ public function toModel()
2526 {
2627 $ class = app ('statamic.eloquent.entries.model ' );
2728
29+ $ data = $ this ->data ();
30+
31+ if ($ this ->blueprint && $ this ->collection ()->entryBlueprints ()->count () > 1 ) {
32+ $ data ['blueprint ' ] = $ this ->blueprint ;
33+ }
34+
2835 return $ class ::findOrNew ($ this ->id ())->fill ([
2936 'id ' => $ this ->id () ?? $ class ::generateId (),
3037 'origin_id ' => $ this ->originId (),
@@ -33,7 +40,7 @@ public function toModel()
3340 'uri ' => $ this ->uri (),
3441 'date ' => $ this ->hasDate () ? $ this ->date () : null ,
3542 'collection ' => $ this ->collectionHandle (),
36- 'data ' => $ this -> data () ,
43+ 'data ' => $ data ,
3744 'published ' => $ this ->published (),
3845 'status ' => $ this ->status (),
3946 ]);
You can’t perform that action at this time.
0 commit comments