File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -754,4 +754,22 @@ public function refresh()
754754
755755 return $ this ;
756756 }
757+
758+ /**
759+ * @inheritDoc
760+ */
761+ public function toArray ()
762+ {
763+ $ embeds = [];
764+
765+ foreach (array_keys ($ this ->getAttributes ()) as $ key ) {
766+ if ($ this ->isEmbedRelation ($ key )) {
767+ $ embeds [] = $ key ;
768+ }
769+ }
770+
771+ $ this ->loadMissing ($ embeds );
772+
773+ return parent ::toArray ();
774+ }
757775}
Original file line number Diff line number Diff line change @@ -98,22 +98,4 @@ public function isEmbedRelation($key)
9898 return $ this ->isRelation ($ key )
9999 && is_a ($ this ->{$ key }(), EmbedsOneOrMany::class, true );
100100 }
101-
102- /**
103- * @inheritDoc
104- */
105- public function toArray ()
106- {
107- $ embeds = [];
108-
109- foreach (array_keys ($ this ->getAttributes ()) as $ key ) {
110- if ($ this ->isEmbedRelation ($ key )) {
111- $ embeds [] = $ key ;
112- }
113- }
114-
115- $ this ->loadMissing ($ embeds );
116-
117- return parent ::toArray ();
118- }
119101}
You can’t perform that action at this time.
0 commit comments