Skip to content

Commit 221b785

Browse files
authored
Merge pull request #713 from mnightingale/cache_adapters
Support CacheAdapters
2 parents 6345d47 + d545900 commit 221b785

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/LfmStorageRepository.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace UniSharp\LaravelFilemanager;
44

55
use Illuminate\Support\Facades\Storage;
6+
use League\Flysystem\Cached\CachedAdapter;
67

78
class LfmStorageRepository implements RepositoryContract
89
{
@@ -25,8 +26,13 @@ public function __call($function_name, $arguments)
2526

2627
public function rootPath()
2728
{
28-
// storage_path('app')
29-
return $this->disk->getDriver()->getAdapter()->getPathPrefix();
29+
$adapter = $this->disk->getDriver()->getAdapter();
30+
31+
if ($adapter instanceof CachedAdapter) {
32+
$adapter = $adapter->getAdapter();
33+
}
34+
35+
return $adapter->getPathPrefix();
3036
}
3137

3238
public function move($new_lfm_path)

0 commit comments

Comments
 (0)