diff --git a/src/Bkwld/Croppa/Storage.php b/src/Bkwld/Croppa/Storage.php index 63578dd..84af827 100644 --- a/src/Bkwld/Croppa/Storage.php +++ b/src/Bkwld/Croppa/Storage.php @@ -112,9 +112,13 @@ public function cropsAreRemote() { // Currently, the CachedAdapter doesn't have a getAdapter method so I can't // tell if the adapter is local or not. I'm assuming that if they are using // the CachedAdapter, they're probably using a remote disk. I've written - // a PR to add getAdapter to it. It is merged into master but not released yet. + // a PR to add getAdapter to it. // https://github.com/thephpleague/flysystem-cached-adapter/pull/9 - if (is_a($adapter, 'League\Flysystem\Cached\CachedAdapter')) return true; + if (is_a($adapter, 'League\Flysystem\Cached\CachedAdapter')) { + if (method_exists($adapter, 'getAdapter')) { + $adapter = $adapter->getAdapter(); // Get the ACTUAL adapter + } else return true; + } // Check if the crop disk is not local return !is_a($adapter, 'League\Flysystem\Adapter\Local');