diff --git a/src/LfmStorageRepository.php b/src/LfmStorageRepository.php index a03d99e9..05b66c23 100644 --- a/src/LfmStorageRepository.php +++ b/src/LfmStorageRepository.php @@ -3,6 +3,7 @@ namespace UniSharp\LaravelFilemanager; use Illuminate\Support\Facades\Storage; +use League\Flysystem\Cached\CachedAdapter; class LfmStorageRepository implements RepositoryContract { @@ -25,8 +26,13 @@ public function __call($function_name, $arguments) public function rootPath() { - // storage_path('app') - return $this->disk->getDriver()->getAdapter()->getPathPrefix(); + $adapter = $this->disk->getDriver()->getAdapter(); + + if ($adapter instanceof CachedAdapter) { + $adapter = $adapter->getAdapter(); + } + + return $adapter->getPathPrefix(); } public function move($new_lfm_path)