File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ class Builder
32
32
*/
33
33
public function getQuery ()
34
34
{
35
- return $ this ->query ;
35
+ return array_merge (
36
+ array_merge (...array_values ($ this ->scopes )),
37
+ $ this ->query
38
+ );
36
39
}
37
40
38
41
/**
@@ -183,7 +186,20 @@ public function forPage($page, $perPage = 15)
183
186
public function withGlobalScope ($ identifier , array $ scope )
184
187
{
185
188
$ this ->scopes [$ identifier ] = $ scope ;
186
- $ this ->where ($ scope );
189
+
190
+ return $ this ;
191
+ }
192
+
193
+ /**
194
+ * Remove a registered global scope.
195
+ *
196
+ * @param string $identifier
197
+ * @return $this
198
+ */
199
+ public function withoutGlobalScope (string $ identifier )
200
+ {
201
+ unset($ this ->scopes [$ identifier ]);
202
+ $ this ->removedScopes [] = $ identifier ;
187
203
188
204
return $ this ;
189
205
}
You can’t perform that action at this time.
0 commit comments