File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 66use League \Flysystem \Local \LocalFilesystemAdapter ;
77use Saloon \CachePlugin \Data \CachedResponse ;
88use Saloon \CachePlugin \Drivers \FlysystemDriver ;
9+ use Saloon \CachePlugin \Drivers \LaravelCacheDriver ;
910
1011class Cache
1112{
@@ -20,10 +21,14 @@ public static function fileSystem(): Filesystem
2021
2122 public static function driver (): FlysystemDriver
2223 {
23- self ::purgeExpired ();
24- return new FlysystemDriver (
25- self ::fileSystem ()
26- );
24+ if (class_exists ('\Illuminate\Support\Facades\Cache ' )) {
25+ return new LaravelCacheDriver (\Illuminate \Support \Facades \Cache::getDefaultDriver ());
26+ } else {
27+ self ::purgeExpired ();
28+ return new FlysystemDriver (
29+ self ::fileSystem ()
30+ );
31+ }
2732 }
2833
2934 public static function purgeExpired (): void
You can’t perform that action at this time.
0 commit comments