File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 77use Saloon \CachePlugin \Data \CachedResponse ;
88use Saloon \CachePlugin \Drivers \FlysystemDriver ;
99use Saloon \CachePlugin \Drivers \LaravelCacheDriver ;
10+ use \Illuminate \Support \Facades \Cache as LaravelCache ;
1011
1112class Cache
1213{
@@ -19,10 +20,10 @@ public static function fileSystem(): Filesystem
1920 );
2021 }
2122
22- public static function driver (): FlysystemDriver
23+ public static function driver (): FlysystemDriver | LaravelCacheDriver
2324 {
24- if (class_exists (' \Illuminate\Support\Facades\Cache ' )) {
25- return new LaravelCacheDriver (\ Illuminate \ Support \ Facades \Cache:: getDefaultDriver ( ));
25+ if (class_exists (LaravelCache::class )) {
26+ return new LaravelCacheDriver (LaravelCache:: repository (LaravelCache:: getStore () ));
2627 } else {
2728 self ::purgeExpired ();
2829 return new FlysystemDriver (
Original file line number Diff line number Diff line change 55use FredBradley \PhpSteerApi \Cache ;
66use Saloon \CachePlugin \Contracts \Cacheable ;
77use Saloon \CachePlugin \Contracts \Driver ;
8+ use Saloon \CachePlugin \Drivers \FlysystemDriver ;
9+ use Saloon \CachePlugin \Drivers \LaravelCacheDriver ;
810use Saloon \CachePlugin \Traits \HasCaching ;
911use Saloon \Contracts \Body \HasBody ;
1012use Saloon \Http \PendingRequest ;
@@ -52,7 +54,7 @@ public function resolveEndpoint(): string
5254 return 'query-data ' ;
5355 }
5456
55- public function resolveCacheDriver (): Driver
57+ public function resolveCacheDriver (): LaravelCacheDriver | FlysystemDriver
5658 {
5759 return Cache::driver ();
5860 }
You can’t perform that action at this time.
0 commit comments