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)
82
82
*/
83
83
protected function getWith (): array
84
84
{
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 ;
86
98
}
87
99
88
100
/**
@@ -92,7 +104,19 @@ protected function getWith(): array
92
104
*/
93
105
protected function getWithout (): array
94
106
{
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 ;
96
120
}
97
121
98
122
/**
You can’t perform that action at this time.
0 commit comments