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
14
14
* Cache policies for the given model.
15
15
*
16
16
* @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 .
18
18
*/
19
- public function cachePolicies (Rule $ model ): Query
19
+ public function cachePolicies (Rule $ model ): Query | Rule
20
20
{
21
21
if ($ this ->config ('cache.enabled ' , false )) {
22
22
$ key = $ this ->config ('cache.key ' , 'tauthz ' );
23
23
$ expire = $ this ->config ('cache.expire ' , 0 );
24
24
return $ model ->cache ($ key , $ expire );
25
25
} else {
26
- return $ model-> newQuery () ;
26
+ return $ model ;
27
27
}
28
28
}
29
29
}
Original file line number Diff line number Diff line change 7
7
8
8
interface CacheHandlerContract
9
9
{
10
- public function cachePolicies (Rule $ model ): Query ;
10
+ public function cachePolicies (Rule $ model ): Query | Rule ;
11
11
}
You can’t perform that action at this time.
0 commit comments