File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,19 @@ public function without($tables)
8282 */
8383 protected function getWith (): array
8484 {
85- return empty ($ this ->with ) ? [] : $ this ->with ;
85+ // Ensure $this->with is set at all
86+ if (empty ($ this ->with ))
87+ {
88+ $ this ->with = [];
89+ }
90+
91+ // Force a single table name into an array
92+ if (! is_array ($ this ->with ))
93+ {
94+ $ this ->with = [$ this ->with ];
95+ }
96+
97+ return $ this ->with ;
8698 }
8799
88100 /**
@@ -92,7 +104,19 @@ protected function getWith(): array
92104 */
93105 protected function getWithout (): array
94106 {
95- return empty ($ this ->without ) ? [] : $ this ->without ;
107+ // Ensure $this->without is set at all
108+ if (empty ($ this ->without ))
109+ {
110+ $ this ->without = [];
111+ }
112+
113+ // Force a single table name into an array
114+ if (! is_array ($ this ->without ))
115+ {
116+ $ this ->without = [$ this ->without ];
117+ }
118+
119+ return $ this ->without ;
96120 }
97121
98122 /**
You can’t perform that action at this time.
0 commit comments