diff --git a/src/MediaManager.php b/src/MediaManager.php index 392e264..039c0d9 100644 --- a/src/MediaManager.php +++ b/src/MediaManager.php @@ -69,8 +69,9 @@ private function initStorage() $disk = static::config('disk'); $this->storage = Storage::disk($disk); + $isLocal = config('filesystems.disks.' . $disk . '.driver') === 'local'; - if (!$this->storage->getDriver()->getAdapter() instanceof Local) { + if (!$isLocal) { Handler::error('Error', '[laravel-admin-ext/media-manager] only works for local storage.'); } } @@ -103,7 +104,7 @@ public function ls() */ protected function getFullPath($path) { - $fullPath = $this->storage->getDriver()->getAdapter()->applyPathPrefix($path); + $fullPath = $this->storage->path($path); // This handles the prefix if (strstr($fullPath, '..')) { throw new \Exception('Incorrect path'); }