File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ class CacheHandler implements CacheHandlerContract
1414 * Cache policies for the given model.
1515 *
1616 * @param Rule $model The model to cache policies for.
17- * @return Query The cached query or a new query if caching is disabled.
17+ * @return Query|Rule The cached query if caching is disabled, or origin Rule .
1818 */
19- public function cachePolicies (Rule $ model ): Query
19+ public function cachePolicies (Rule $ model ): Query | Rule
2020 {
2121 if ($ this ->config ('cache.enabled ' , false )) {
2222 $ key = $ this ->config ('cache.key ' , 'tauthz ' );
2323 $ expire = $ this ->config ('cache.expire ' , 0 );
2424 return $ model ->cache ($ key , $ expire );
2525 } else {
26- return $ model-> newQuery () ;
26+ return $ model ;
2727 }
2828 }
2929}
Original file line number Diff line number Diff line change 77
88interface CacheHandlerContract
99{
10- public function cachePolicies (Rule $ model ): Query ;
10+ public function cachePolicies (Rule $ model ): Query | Rule ;
1111}
You can’t perform that action at this time.
0 commit comments