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
3232 */
3333 public function getQuery ()
3434 {
35- return $ this ->query ;
35+ return array_merge (
36+ array_merge (...array_values ($ this ->scopes )),
37+ $ this ->query
38+ );
3639 }
3740
3841 /**
@@ -183,7 +186,20 @@ public function forPage($page, $perPage = 15)
183186 public function withGlobalScope ($ identifier , array $ scope )
184187 {
185188 $ 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 ;
187203
188204 return $ this ;
189205 }
You can’t perform that action at this time.
0 commit comments