File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -420,4 +420,6 @@ public function __call($method, $parameters)
420
420
}
421
421
422
422
public function boot ($ query ){}
423
+
424
+
423
425
}
Original file line number Diff line number Diff line change @@ -161,6 +161,12 @@ class Query
161
161
*/
162
162
public $ model ;
163
163
164
+ /**
165
+ * Use model global scopes
166
+ * @var bool
167
+ */
168
+ public $ useGlobalScopes = true ;
169
+
164
170
165
171
/**
166
172
* Query constructor.
@@ -745,7 +751,7 @@ public function query()
745
751
$ query ["type " ] = $ this ->getType ();
746
752
}
747
753
748
- if ($ this ->model ){
754
+ if ($ this ->model && $ this -> useGlobalScopes ){
749
755
$ this ->model ->boot ($ this );
750
756
}
751
757
@@ -1383,4 +1389,14 @@ function __call($method, $parameters)
1383
1389
}
1384
1390
1385
1391
}
1392
+
1393
+ /**
1394
+ * @return $this
1395
+ */
1396
+ public function withoutGlobalScopes (){
1397
+
1398
+ $ this ->useGlobalScopes = false ;
1399
+
1400
+ return $ this ;
1401
+ }
1386
1402
}
You can’t perform that action at this time.
0 commit comments