We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 698a285 commit 9ea0b37Copy full SHA for 9ea0b37
1 file changed
src/Cache.php
@@ -6,6 +6,7 @@
6
use League\Flysystem\Local\LocalFilesystemAdapter;
7
use Saloon\CachePlugin\Data\CachedResponse;
8
use Saloon\CachePlugin\Drivers\FlysystemDriver;
9
+use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
10
11
class Cache
12
{
@@ -20,10 +21,14 @@ public static function fileSystem(): Filesystem
20
21
22
public static function driver(): FlysystemDriver
23
- self::purgeExpired();
24
- return new FlysystemDriver(
25
- self::fileSystem()
26
- );
+ if (class_exists('\Illuminate\Support\Facades\Cache')) {
+ return new LaravelCacheDriver(\Illuminate\Support\Facades\Cache::getDefaultDriver());
+ } else {
27
+ self::purgeExpired();
28
+ return new FlysystemDriver(
29
+ self::fileSystem()
30
+ );
31
+ }
32
}
33
34
public static function purgeExpired(): void
0 commit comments