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 6
6
use League \Flysystem \Local \LocalFilesystemAdapter ;
7
7
use Saloon \CachePlugin \Data \CachedResponse ;
8
8
use Saloon \CachePlugin \Drivers \FlysystemDriver ;
9
+ use Saloon \CachePlugin \Drivers \LaravelCacheDriver ;
9
10
10
11
class Cache
11
12
{
@@ -20,10 +21,14 @@ public static function fileSystem(): Filesystem
20
21
21
22
public static function driver (): FlysystemDriver
22
23
{
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
+ }
27
32
}
28
33
29
34
public static function purgeExpired (): void
You can’t perform that action at this time.
0 commit comments