44
55use Closure ;
66use Illuminate \Console \Command ;
7+ use Illuminate \Database \Eloquent \Concerns \HasUuids ;
78use Illuminate \Support \Facades \Facade ;
89use Statamic \Console \RunsInPlease ;
910use Statamic \Contracts \Entries \CollectionRepository as CollectionRepositoryContract ;
1011use Statamic \Contracts \Entries \Entry as EntryContract ;
1112use Statamic \Contracts \Entries \EntryRepository as EntryRepositoryContract ;
12- use Statamic \Eloquent \Entries \EntryModel ;
1313use Statamic \Entries \Entry as StacheEntry ;
1414use Statamic \Facades \Entry ;
1515use Statamic \Stache \Repositories \CollectionRepository ;
@@ -63,7 +63,7 @@ private function usingDefaultRepositories(Closure $callback)
6363
6464 private function importEntries ()
6565 {
66- $ entries = EntryModel ::all ();
66+ $ entries = app ( ' statamic.eloquent.entries.entry ' ) ::all ();
6767
6868 $ entriesWithOrigin = $ entries ->filter (function ($ model ) {
6969 return (bool ) $ model ->origin_id ;
@@ -83,9 +83,13 @@ private function importEntries()
8383 ->slug ($ model ->slug )
8484 ->collection ($ model ->collection )
8585 ->data ($ model ->data )
86- ->blueprint ($ model ->data [ ' blueprint ' ] ?? null )
86+ ->blueprint ($ model ->blueprint )
8787 ->published ($ model ->published );
8888
89+ if (in_array (HasUuids::class, class_uses_recursive ($ model ))) {
90+ $ entry ->id ($ model ->getKey ());
91+ }
92+
8993 if ($ model ->date && $ entry ->collection ()->dated ()) {
9094 $ entry ->date ($ model ->date );
9195 }
0 commit comments