File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ public function resetScope(): static;
8989
9090 public function applyScope (): static ;
9191
92+ public function getBaseQuery (): mixed ;
93+
9294 public static function __callStatic ($ method , $ arguments );
9395
9496 public function __call ($ method , $ arguments );
Original file line number Diff line number Diff line change 1212use CodeOfDigital \CacheRepository \Exceptions \RepositoryException ;
1313use Illuminate \Container \Container as Application ;
1414use Illuminate \Database \Eloquent \Builder ;
15+ use Illuminate \Database \Query \Builder as QueryBuilder ;
1516use Illuminate \Database \Eloquent \Model ;
1617use Illuminate \Database \Eloquent \SoftDeletes ;
1718use Illuminate \Support \Collection ;
@@ -546,6 +547,17 @@ public function applyScope(): static
546547 });
547548 }
548549
550+ public function getBaseQuery (): QueryBuilder
551+ {
552+ $ this ->applyCriteria ();
553+ $ this ->applyScope ();
554+
555+ $ query = $ this ->model ->toBase ();
556+
557+ $ this ->resetModel ();
558+ return $ query ;
559+ }
560+
549561 protected function applyCriteria (): static
550562 {
551563 if ($ this ->skipCriteria ) return $ this ;
You can’t perform that action at this time.
0 commit comments